Abdullah Shafique of Pakistan scored his second Test century on day four of the first Test against Sri Lanka in Galle, setting the tourists up for a monumental chase.
Pakistan concluded the two-Test series on 222-3, needing 120 runs to take the lead.
After scoring 337 in their second innings, Sri Lanka seemed to be in the lead after setting Pakistan a difficult goal of 342.
Imam-ul-Haq (35) and Shafique worked together in an opening stand of 87, and they later reached 101 with captain Babar Azam (55), showing a marked improvement in the tourists’ batting performance after they were skittled out for 218 in the first innings.
Five fours and a six were included in Shafique’s unbeaten 112, and he had Mohammad Rizwan on seven at the other end.
Shafique and Imam, however, did not come across as very persuasive when Pakistan started to pursue them.
Shafique survived a potent leg-before appeal while Imam was dropped at cover and had a lbw judgement against him overturned.
Imam’s innings came to an odd end when he released a ball from the spinner Ramesh Mendis, but in doing so, he slightly elevated his rear foot, which gave Niroshan Dickwella the opportunity to quickly stump him.
When Azhar Ali was caught in the slip by Jayasuriya for six, Sri Lanka appeared to be back in control.
Babar, who scored a century in the first innings, started off by flicking Jayasuriya for four runs before hitting the spinner over deep midwicket for six runs in the following over.
When Shafique reached his hundred, he accepted a single from Maheesh Theekshana and celebrated by kissing his helmet and cuddling up to his captain Babar.
Despite Pakistan appearing to be ahead in the match, Jayasuriya bowled Babar around his legs in the final session.