Galle: Pakistan ended day four at 48-3 as they chase the 131-run target set by Sri Lanka in the first Test being played in Galle.
Imam-ul-Haq and Babar Azam were unbeaten on 25 and six runs, respectively, at the end of day four.
Pakistan requires another 83 runs to win the match on the final day and take a 1-0 lead in the two-match series.
Prabath Jayasuriya claimed two top-order wickets of Pakistan after dismissing Abdullah Shafique (8) and Shan Masood (7).
Meanwhile, nightwatchman Nauman Ali was run out after attempting a suicidal second run.
Sri Lanka were dismissed for 279 in their second innings, earlier during the day, which meant that Pakistan were set a target of 131 runs to win the match.
Abrar Ahmed and Nauman Ali were the chief destroyers for Pakistan after claiming three wickets each. Meanwhile, Shaheen Afridi and Agha Salman bagged two wickets each.
Dhananjaya de Silva, who scored a ton in the first innings, was the top scorer for the home side once again after notching up 82 runs.
Sri Lanka were 210-6 at tea with a lead of 61 runs after losing three wickets in the second session.
Nishan Madushka departed after scoring 52 runs with the help of seven fours and a six. Dinesh Chandimal (28) and Sadeera Samarawickrama (11) also could not stay out in the middle for a long period.
Agha Salman claimed two wickets in the post-lunch session, meanwhile, one was bagged by Nauman.
Earlier, the home side lost three wickets in the morning session and slipped to 94-3 at lunch.
All three wickets in the first session were claimed by Pakistan’s spinners with Nauman Ali bagging two and Abrar Ahmed securing one scalp.
Abrar dismissed Sri Lanka spinner Dimuth Karunaratne for 20, meanwhile, Nauman trapped Kusal Mendis in front of the stumps for 18.
Towards the end of the first session, Pakistan captain Babar Azam took a stunning one-handed catch at first slip, on the bowling of Nauman, to send Angelo Mathews (7) back to the hut.
Earlier, Saud Shakeel notched up his maiden double century in Tests as Pakistan took a 149-run lead against Sri Lanka on day three of the rain-hit opening match on Tuesday.
The visitors were bowled out for 461 in the final session on day three after a frustrating ninth-wicket partnership of 94 between Shakeel, who remained not out on 208, and Naseem Shah, who scored six off 78 balls.
The 27-year-old Shakeel, who is playing his sixth Test, smacked Dhananjaya de Silva for a boundary to reach double century and received a standing ovation.
“When Naseem Shah joined me, he said that there´s a chance for me to go for the double hundred,” Shakeel told reporters after the marathon knock.
“A lot of credit to him for backing me and not letting me panic.”
The hosts ended the day 14-0 after bad light stopped play.
Nishan Madushka, on eight, and skipper Dimuth Karunaratne, on six, were batting at stumps.
Spinner Ramesh Mendis ended with a five-wicket haul but Shakeel combined with the tailenders including a 52-run seventh-wicket partnership with Nauman Ali, who scored 25.
But it was his 177-run partnership with Agha Salman, who hit 83, which brought Pakistan back in the game after slipping to 101-5 in their reply to Sri Lanka´s 312.
“When I went in to bat, I wanted to attack If I had tried to be defensive we would have got bowled out for 150,” said Shakeel.
“That´s the reason I attacked and was able to take the game deep.”
Sri Lanka coach Chris Silverwood said: “I don´t think we did our best with the ball. It´s good to see Ramesh get five wickets haul which he deserved as a unit we weren´t good as we could have been.”
“We managed to control their run rate to an extent today but unfortunately, we missed a couple of key chances that cost us.”