Dinesh Chandimal struck his second successive half-century to take Sri Lanka’s lead past 300 and thwart the Pakistan attack on day three of the opening Test on Monday.
The hosts were 329 for nine when bad light stopped play for the day in Galle.
Chandimal, on 86, and Prabath Jayasuriya, on four, were batting at close of play with Sri Lanka leading by 333 in their second innings.
Mohammad Nawaz claimed his maiden five-wicket haul and combined with fellow spinner Yasir Shah, who took three, to rattle the opposition middle-order in the second session.
But Chandimal, who struck blazing form with his maiden double century — 206 not out — in his team’s series-levelling Test win over Australia last week, stood firm in another lower-order show of defiance after the hosts slipped to 235-7.
He reached his fifty and put on 41 runs with Maheesh Theekshana for the ninth wicket in a repeat performance from the hosts, who had hit back from 133-8 to post 222 in their first innings.
Earlier Kusal Mendis made 76 and opener Oshada Fernando scored 64 and put on a key third-wicket stand of 91 to fight back after an early wicket in the morning session.
Oshada reached his sixth Test fifty in the first session but fell to Yasir on the second ball after lunch.
Kusal raised his fifty and took on the opposition attack with a few boundaries before Yasir bowled him with an unplayable delivery that pitched outside leg and turned to hit the top of off stump.
Nawaz, who is making a Test comeback after nearly six years and playing his fourth five-day match, kept chipping away and got key wickets including Angelo Mathews and Niroshan Dickwella.
He got nightwatchman Kasun Rajitha on the third ball of the day to set things rolling for Pakistan, but the Sri Lankan batsmen kept coming back on a pitch that is expected to offer more turn to the spinners come day four.
In a keenly contested match of tail end fights, Pakistan had also hit back to post 218, riding on skipper Babar Azam’s 119 as he batted with his own lower order on day two.