Sri Lanka fought their way into an 82-run lead but Pakistan remained firmly in control of the second Test after reducing the visitors to 309-9 at stumps on the third day at the Rawalpindi Cricket Stadium on Thursday.
Milan Rathnayake led the resistance with an unbeaten 60, while Kusal Mendis and Sonal Dinusha also scored half-centuries to help Sri Lanka recover from a precarious position.
However, Pakistan’s bowlers continued to make regular breakthroughs, leaving the hosts needing just one more wicket before beginning their chase.
Sri Lanka resumed their second innings at 74-3, still trailing Pakistan by 153 runs after being bowled out for 98 in their first innings. Pakistan had responded with 325 to establish a commanding 227-run advantage.
The visitors lost two more wickets during the morning session as Pakistan’s fast bowlers maintained pressure. Aamer Jamal trapped Dhananjaya de Silva lbw for 37, with the batter’s review unable to overturn the decision. Sri Lanka were 99-4.
Razaullah then ended Pasindu Sooriyabandara’s resistance, having him caught behind by wicket-keeper Ghazi Ghori for 38 off 116 deliveries. Sooriyabandara had struck three fours during an innings that helped Sri Lanka weather the early pressure.
The visitors reached lunch at 166-5, with Kusal Mendis unbeaten on 32 and Dinusha on 19. The pair continued to rebuild after the interval, putting together an 81-run partnership that brought Sri Lanka back into the contest.
Kusal completed his 24th Test half-century, scoring 53 from 126 balls with eight fours. His innings ended at 215-6 when he attempted a sweep against Salman Ali Agha but played the ball onto his leg stump.
Dinusha carried on, reaching 54 from 119 deliveries with seven fours, while Rathnayake provided further resistance after joining him at the crease. The pair took Sri Lanka to 241-6 at tea, giving the visitors a 14-run lead.
Rathnayake, who had scored 17 by the interval, grew increasingly confident in the final session. Dinusha, meanwhile, continued to frustrate Pakistan despite having been struck on the hand by a delivery from Jamal earlier in the day.
Pakistan took the second new ball after 80 overs, and Aamer soon provided the breakthrough. Dinusha attempted a pull shot but sent the ball towards midwicket, where Azan Awais took a sharp catch to dismiss him for 54 at 268-7.
Rathnayake remained composed and reached his second Test half-century with a boundary off Razaullah in the 90th over. He continued to attack when opportunities arose, moving to 60 not out from 82 balls, including 11 fours.
Mohammad Abbas then struck twice to further expose the tail, dismissing Prabath Jayasuriya for one and Lahiru Kumara for five. Abbas finished with figures of 2-54 from 33 overs, including 15 maidens, while Aamer claimed 3-67.
Pakistan had to manage their bowling resources without Saqib Khan, who was ruled out of further bowling after sustaining a left hamstring strain. Saqib had earlier dismissed Lahiru Udara for seven.
With Asitha Fernando unbeaten on two alongside Rathnayaka, Sri Lanka closed on 309-9. Bad light brought play to an end at 4:35pm, leaving Pakistan one wicket away from ending the innings.

