Pallekele - Younis Khan and Shan Masood smashed unbeaten centuries on Monday to keep Pakistan in contention for a record Test win against Sri Lanka.
The tourists finished day four of the third and deciding Test on 230-2 and require a further 147 runs with one day left.
The pair added an unbroken 217-run stand for the third wicket after Pakistan chasing a seemingly impossible 377 to win were reduced to 13-2.
No team has successfully chased more than 352 in Sri Lanka while Pakistan's highest successful run chase is 315-9 against Australia in Karachi in 1994.
It was Masood's maiden Test century. Playing in just his fifth Test match, the 25-year-old opener helped Pakistan rebuild their innings and restored hopes of an impressive series win.
Sri Lanka reviewed two leg before wicket shouts against Masood unsuccessfully when he was on 11 and 79.
Younis, who was run out for three in the first innings, did not allow spinner Tharindu Kaushal to settle. He reached his 30th test hundred and the eighth against Sri Lanka with a glorious cover drive in the penultimate delivery before stumps.
Masood took 93 balls for his 50 and 172 balls for his century which he reached by charging down to Kaushal and smashing a six over long-on.
Sri Lanka skipper Angelo Mathews used all his resources, including part-time spinner Jehan Mubarak, but was unable to break the stand.
The scoreboard at stumps:
Sri Lanka 1st Innings: 278 all outPakistan 1st Innings: 215 all outSri Lanka 2nd Innings(overnight 228-5)Dimuth Karunaratne b Rahat 10
Kaushal Silva c Misbah b Eshan 3
Upul Tharanga c Azhar by Yasir 48
Lahiru Thirimanne b Rahat 0
Angelo Mathews c Sarfraz b Imran 122
Jehan Mubarak c Azhar b Yasir 35
Dinesh Chandimal lbw b Imran 67
Dhammika Prasad c Sarfraz b Imran 0
Tharindu Kaushal c Sarfraz b Imran 8
Suranga Lakmal c Sarfraz b Imran 0
Nuwan Pradeep not out 4
Extras: (4b, 9lb, 3w) 16
TOTAL: (all out) 313
Overs: 95.4
Fall of wickets: 1-12, 2-22, 3-35, 4-80, 5-161, 6-278, 7-278, 8-290, 9-306, 10-313.
Bowling: Rahat Ali 21-3-82-2 (1w), Eshan Adil 17-4-66-1 (1w), Imran Khan 20.4-3-58-5 (1w), Yasir Shah 32-7-80-2, Azhar Ali 5-1-14-0.
Pakistan 2nd InningsShan Masood not out 114
Ahmed Shehzad b Lakmal 0
Azhar Ali c Chandimal b Prasad 5
Younis Khan not out 101
Extras: (6lb, 1w, 3nb) 10
TOTAL: (for 2 wickets) 230
Overs: 63
Fall of wickets: 1-0, 2-13.
To bat: Misbah-ul-Haq, Asad Shafiq, Sarfraz Ahmed, Yasir Shah, Eshan Adil, Imran Khan, Rahat Ali.
Bowling: Dhammika Prasad 13-2-42-1, Suranga Lakmal 12-2-34-1 (3nb), Nuwan Pradeep 10-2-32-0 (1w), Angelo Mathews 6-1-15-0, Tharindu Kaushal 20-1-92-0, Jehan Mubarak 2-0-9-0.
Toss: Pakistan.
Umpires: Ian Gould, England, and Paul Reiffel, Australia.
TV umpire: Sundaram Ravi, India. Match referee: