The hosts had reached 300 for two by the close with opener Dilshan having posted 101 and an unbeaten Sangakkara 111. A breezy 55 not out from captain Mahela Jayawardene added further gloss to the score as only Saeed Ajmal had any luck with ball in hand, taking the only wickets to fall for 81 runs.
He had Tharanga Paranavitana stumped (24) and then trapped Dilshan to end his 180-ball vigil. It had been Dilshan's 13th Test hundred but, by the time he was dismissed, his side were already comfortably in command.
After Jayawardene put his men in, Dilshan and Paranavitana set off at a brisk pace, meaning that when the latter fell, the score was up to 63 from 15.5 overs. Concerned by the failure of his quicks to snare either of them, stand-in Pakistan captain Mohammad Hafeez threw the ball to Ajmal and his impact was immediate.
Three balls into his opening over he thought he had pinned Paranavitana in front, only for the appeal to be denied, before luring him down the track to one he missed, allowing Azhar Ali to rearrange the stumps with him well out of his ground.
That brought Sangakkara to the middle and he immediately set about his task, rotating the strike with Dilshan who passed 50 in 49 balls and reached his 100 in 175, bringing it up with a well-timed sweep off Abdur Rehman. The 35-year-old did not enjoy the smoothest of passages to three figures, though.
On a dry pitch seemingly made for spinners, he survived a number of leg before appeals and, when he did go, it was fitting that it was to such a decision, with Ajmal getting one to straighten that gave him little room for manoeuvre.
Tea was reached with no further losses, however, with Sangakkara on 56 and Jayawardene still to score, more than 100 runs were added in the final session, ensuring a frustrating end to the day for the tourists.
The failure of their pacemen to trouble Sri Lanka's batsmen early on allowed the home side to settle, something Sangakkara illustrated late in the day as he cut loose to draw level with Sir Donald Bradman's 29 Test hundreds, but he brought it up by diving into the dust to prevent a run out after stealing a quick single off Ajmal.
Sangakkara's century came from 159 balls and, with Jayawardene taking 89 to get to his half-century, there was little encouragement for Pakistan in a deflating last session.