Kusal Mendis and Oshada Fernando set a platform with their 91-run partnership, the middle order then thrust Sri Lanka onward in an urgent middle session, and Dinesh Chandimal gave Sri Lanka command of the first Galle Test, hitting 86 not out off 121 balls while putting up lively stands with the tail.
Mohammad Nawaz wheeled his way to a maiden five-wicket haul, and Yasir Shah produced some spectacular legbreaks, but Pakistan's situation in this match is looking increasingly dire. On a surface taking substantial turn, they are now 333 runs behind, with one opposition wicket still to get. The highest successful chase in Galle is 268; the highest fourth-innings score of any description is 300.
Half-centuries from Fernando, Kusal, and Chandimal tied Sri Lanka's innings together, and it was the morning's third-wicket stand that set Sri Lanka up for a strong batting day. At this stage, Sri Lanka were more or less batting normally, Fernando coming down the track to create single options either side of the pitch, while Mendis played more on his back foot to take toll of the shorter deliveries, which came too often from the Pakistan spinners.
There were occasional big shots before lunch, such as when Fernando ran down the track and launched Yasir into the sightscreen roughly midway through the session. But largely, the batters were happy to wait for the bowlers to err, which they did, rarely managing to build pressure, as they gave up runs to Kusal's sweep, or Fernando's cuts. Fernando got to his half-century towards the end of the first session, but was out soon after the break, edging Nawaz to slip.
But then, thanks partly to Kusal, who reached his own fifty early in the second session, Sri Lanka raised the tempo. He began to sweep violently, and find easy singles into the outfield, until eventually, when on 76, he got the best ball of the match - a fast, but big-spinning legbreak, from Yasir that pitched well outside leg, but ripped to beat the outside edge, and clip the off stump.
Already having built a decent score, Sri Lanka's middle-order batters were undeterred by these losses. Through the afternoon session, they kept coming at Pakistan's bowlers, never with more intent than when Dhananjaya de Silva joined Chandimal at the crease. Their partnership of 40 came off 36 balls, and featured three sixes and two fours. De Silva was out to another excellent Yasir delivery that rushed him, but then Niroshan Dickwella also produced a brisk-but-brief innings to keep Sri Lanka cantering.
By tea, they were seven down, but 261 runs ahead, having scored at 4.4 runs an over through that session.