Pakistan posted their highest first innings Test match total for eight years as they continued to hold the upper hand against Sri Lanka in Galle.
Sri Lanka ended day two of the first Test on 99-1, still 352 runs behind after Younis Khan hit 177 in Pakistan's total of 451.
Half-centuries down the order from wicketkeeper Sarfraz Ahmed (55) and Abdur Rehman (50) helped Pakistan on their way before Sri Lanka's long stint in the field ended as Dilruwan Perera mopped up to finish with figures of 5-137.
Resuming on 261-4, Asad Shafiq was the first Pakistan batsman to fall on the second morning, departing lbw to Rangana Herath for 75 after adding 20 runs to his overnight score.
But Sri Lanka had to wait until after lunch before Younis Khan's 331-ball innings ended when he was caught at mid-wicket off Perera.
Sarfraz Ahmed and Rehman then added runs at a prolific rate and, although Perera kept plugging away, Pakistan moved past 450.
Sri Lanka set about their response in an unconvincing fashion, and opener Upul Tharanga lasted just 15 deliveries before he fell lbw to Junaid Khan for 19 with the score on 24.
Tharanga's departure brought Kumar Sangakkara out to join Kaushal Silva, and although Pakistan's bowlers consistently found the edge of Silva's bat, he kept his composure to remain unbeaten at the close of play.
Silva moved to 38 not out, with Sangakkara undefeated on 36 as their second wicket partnership realised 75 runs.