Pallekele: Skipper Angelo Mathews steadied Sri Lanka with a watchful unbeaten 31 after Pakistan had scalped the top order cheaply in the series-deciding third and final Test in Pallekele on Sunday.
The hosts, who gained a first innings lead of 63 runs, recovered from 35 to three to post 112-4 in their second knock by tea on the rain-interrupted third day.
Mathews put on 45 for the fourth wicket with Upul Tharanga (48) and 32 for the undefeated fifth with Jehan Mubarak (nine) to increase the lead to 175 runs with six wickets in hand.
The tourists added six runs to their overnight score of 209-9 before they were all out for 215 in the day's second over in reply to Sri Lanka's first innings total of 278.
When Sri Lanka batted a second time, left-arm seamer Rahat Ali grabbed two quick wickets and new ball partner Ehsan Adil took one to leave the hosts tottering in the morning session.
Rahat bowled first innings century-maker Dimuth Karunaratne for 10 and yorked Lahiru Thirimanne for no score in an inspired eight-over opening spell.
In between, Ehsan had Kaushal Silva caught in the slips by a diving Misbah-ul Haq for three.
Tharanga and skipper Angelo Mathews repaired the early damage on either side of lunch before leg-spinner Yasir Shah broke the partnership.
Having had an leg-before review turned down by the TV umpire off the previous ball, Yasir forced left-hander Tharanga to edge the next delivery to Azhar Ali at short-leg.
Play was held up twice by passing showers in the morning session and once again before tea, keeping the hard-working ground staff on their toes as they rushed in the covers to guard both the wicket and the outfield.
Pakistan's six runs in the morning all came off the bat of Sarfraz Ahmed, who remained unbeaten on 78.
Last man Imran Khan, who had not faced a ball in four previous Tests, survived for seven deliveries before he was bowled by off-spinner Tharindu Kaushal for zero.
Kaushal, Dhammika Prasad and Nuwan Pradeep finished with three wickets each.
The series is tied at 1-1 after Pakistan won the first Test in Galle by 10 wickets and Sri Lanka took the second in Colombo by seven wickets.