Batting on 286 with number 11 batsman Nuwan Pradeep, Sangakkara hit left-arm spinner Shakib Al Hasan for a four and two sixes off successive deliveries to first go past his previous best score of 287 and then reach his maiden triple hundred in spectacular fashion.
Sangakkara, 36, was fastest to the 11000 test-run club, having bettered West Indies batting great Brian Lara's record by five innings.
Kithuruwan Vithanage (35) and Ajantha Mendis (47) provided able support to Sangakkara and added 90 and 100 for the sixth and eighth wickets respectively.
All-rounder Shakib completed his 11th five-wicket haul but Bangladesh would require something of a miracle to win the test and square the two-match series after losing the first test in Dhaka by an innings and 248 runs.
(Writing by Sudipto Ganguly; editing by Amlan Chakraborty)
