Pakistan's wicket-keeper Sarfraz Ahmed smashed a maiden Test century as the tourists took a 12-run first-innings lead against Sri Lanka in the second and final match in Colombo on Saturday.
Left-arm spinner Rangana Herath claimed a career-best 9-127, but Pakistan carried their overnight score of 244-6 to 332 before they were all out at the stroke of lunch on the third day at the Sinhalese Sports Club.
The tourists, seeking a series-levelling win after losing the first Test in Galle by seven wickets, will look to dismiss Sri Lanka cheaply on a wearing pitch that has begun to take slow turn.
Also Read
Sri Lanka made 320 in the first innings.
Sarfraz, who came to bat after tea on Friday with Pakistan struggling at 140-5, scored a gutsy 103 to lead a remarkable fightback by the lower order.
Resuming on 66, Sarfraz reached his hundred by hooking left-arm seamer Chanaka Welegedara for a six after pulling the previous delivery for a boundary.
He was ninth out with Pakistan just six runs away from taking the lead when he edged Herath to give wicket-keeper Niroshan Dickwella his fifth catch in the innings.
Last man Junaid Khan hit an unbeaten 13 to help Pakistan go past Sri Lanka's total.
Herath, who earlier in the morning had dismissed overnight batsman Abdur Rehman (16) and Wahab Riaz (17), surpassed his previous best of seven for 89 against Bangladesh in Colombo last year.
The 36-year-old Herath is the number one Test spinner in the official rankings. He has claimed 255 wickets so far in 57 Tests.