Sri Lanka recovered after losing three early wickets and closed in on Pakistan’s first innings total on day two of the second and final Test in Karachi on Friday.
The visitors had made 170-6 by lunch, in reply to Pakistan’s 191.
Dinesh Chandimal was unbeaten on 42 with Niroshan Dickwella on ten.
Pakistan needed early wickets and fast bowlers Shaheen Shah Afridi and Mohammad Abbas stepped up to rattle Sri Lanka, who had resumed at 64-3.
Abbas had nightwatchman Lasith Embuldeniya caught in the slip for 13 before lanky left-armer Afridi had Angelo Mathews caught behind for 13.
Sri Lanka were hobbling at 80-5 before Chandimal and first Test centurion Dhananjaya de Silva (32) added 67 runs for the sixth wicket to steady their team.
Afridi broke the stand by luring De Silva into hooking straight into the hands of deep square-leg fielder Abbas who held a running catch.
Chandimal has so far hit five boundaries in his 87-ball innings.
The Test series — part of the ongoing World Test championship — is the first in Pakistan since a militant attack on the Sri Lankan team bus in 2009 suspended international cricket in the country. The rain-ravaged first Test in Rawalpindi was drawn.