Pakistan lost the wicket of opener Salman Butt minutes before the close of play as they started their innings in response to Sri Lanka's 644 for seven declared on day two of the first Test in Karachi.
Sri Lanka resumed on 406 for three and Mahela Jayawardene (240) and Thilan Samaraweera (231) converted their overnight centuries into doubles before their fourth-wicket stand of 437 was finally broken when Jayawardene was caught by Kamran Akmal off of Shoaib Malik.
Danish Kaneria then bowled Samaraweera with a googly, Malik struck again to remove Tillakaratne Dilshan for a duck and the innings was brought to a close when Prasanna Jayawardene was also bowled by leg-spinner Kaneria.
Mahela Jayawardene stroked 32 fours in 423 balls while Samaraweera hit 31 boundaries, facing 318 deliveries.
Pakistan made a solid start to their first innings, Butt and Khurram Manzoor putting on 44 in 20.3 overs before Butt, who had made 23 in 70 balls, was caught by Mahela Jayawardene off of Muttiah Muralitharan.
Manzoor was unbeaten on 18 while skipper Younus Khan played out three deliveries without scoring.
Malinda Warnapura and Kumar Sangakkara also scored half-centuries on day one after Sri Lanka won the toss.