Monday had been a momentous day for the tourists, with captain Mushfiqur Rahim becoming the first Bangladesh player to make a double century and the Tigers posting their highest ever total of 638, a first-innings lead of 68 which was soon wiped out by their opponents.
And resuming on 116 for one, Tillakaratne Dilshan and Kumar Sangakkara picked up where they left off to both hit hundreds for Sri Lanka.
Dilshan, who began the final day on 63, was the first to pass the mark in 139 balls by clipping a single to square leg.
And Sangakkara also completed his ton from a single to become the fifth batsman to score twin centuries in a Test match for Sri Lanka.
The pair could not be budged and by the interval the hosts had put on 230 for one, an overall - if immaterial - lead of 162 runs.
Dilshan was unbeaten on 120 while Sangakkara was 105 not out.