Andrew Fidel Fernando is ESPNcricinfo's Sri Lanka correspondent. @afidelf
SA v BAN (W) (1)
Abu Dhabi T10 (3)
BAN v NZ (1)
SA v WI (A tour) (1)
BBL 2023 (1)
AUS v PAK (1)
Asia Cup [U19] (2)
Stumps Pakistan 89 for 1 (Imam 46*, Babar 26*, Jayasuriya 1-46) and 231 trail Sri Lanka 378 and 360 for 8 by 419 runs
Sri Lanka gained a virtually unassailable position in the second Test, as Dhananjaya de Silva hit a ninth Test century, and Dimuth Karunaratne and Ramesh Mendis joined him in substantial partnerships.
But they were only able to take one Pakistan wicket before bad light set in, and 26 overs were lost to the day. Perhaps because Pakistan had chased down 342 in the first Test, Sri Lanka had waited until their lead had stretched to 507 before declaring their second innings closed. They will now be under significant pressure to claim early wickets on day five, to give themselves a chance of leveling the series.
The centrepiece of Sri Lanka's second innings was de Silva's 126-run stand with Karunaratne, who himself struck a half-century despite visibly struggling with a back sprain. The pair had come together with the score on 116 for 5 on the third day, and had put on 59 together by stumps.
Early on day four, they each had a little luck. De Silva had mis-hit a cut shot against Hasan Ali in the second over, and the inside edge passed perilously close to the stumps. Karunaratne then played back to Nauman Ali's first ball of the day, and would have been lbw had the umpire given him out on the field. In the end, Pakistan reviewed, and Karunaratne was saved by an umpire's call on line.
Eventually, though, the batters settled and the runs began to flow. De Silva used the sweep to excellent effect, once slogging Yasir Shah over midwicket for four, while Karunaratne used the reverse sweep to access empty space behind point. Largely, though, the batters preferred to use their feet to find the single options. Karunaratne brought up his half-century off the 97th ball he faced; de Silva off his 102nd, two overs later.
Karunaratne was out to an excellent reflex catch at short leg by Shafique, off Nauman's bowling. But by that stage, the pair had delivered Sri Lanka to an incredibly strong position. De Silva went to lunch on 84, and needed only 16 balls to complete his century in the company of Ramesh, as he found square boundaries on either side of the pitch with relative ease against the spinners.
Ramesh then attacked to speed Sri Lanka towards their declaration, which only came when de Silva was run out for 109 at the non-striker's end, roughly 40 minutes into the afternoon session. Ramesh seemed to have called his partner through for a run, but sent him back when it was clear that Yasir Shah was swooping on the ball from midwicket. Yasir's direct hit caught de Silva metres short.
On a pitch that wasn't taking substantial turn yet, Pakistan's spinners were unable to put Sri Lanka under pressure consistently on day four. Seamer Naseem Shah, who had bowled an excellent spell at the start of the day, returned Pakistan's best figures of 2 for 44 from his 12.5 overs.
Pakistan made a bright start to the fourth innings, even if both Abdullah Shafique and Imam-ul-Haq lived dangerously at times. Shafique was almost caught at short leg off the bowling of Asitha Fernando, although that delivery was deemed a no-ball in any case. Sri Lanka then raised strong lbw appeals against Imam, though none they were willing to review.
Having been burned by Shafique in the first Test, Sri Lanka were thrilled to see him make a mistake in this fourth innings. Having seen out 50 balls, he ran at Prabath Jayasuriya to try and launch him over mid-off, perhaps in an attempt to force Sri Lanka to spread the field. Having not quite got to the pitch of the ball, he mis-hit it high into the air. Dunith Wellalage sprinted back from mid-on to get underneath the high, swirling catch, much to his teammates' delight.
Imam and Babar Azam saw Pakistan through until the light faded, frequently looking for runs, even if a Pakistan victory seems virtually impossible. By stumps Imam had moved to 46 off 80; Babar to 26 off 38.
Galle defeat highlights Babar's struggle in using his spinners
Where Sri Lanka trusted Jayasuriya and Mendis to win the game for them, Pakistan always kept chopping and changing
Stats - Jayasuriya's record-breaking start, Galle's result streak, and Babar's fourth-innings form
All the important numbers from the second Test in Galle, where Sri Lanka secured their biggest win over Pakistan
Babar Azam: 'Pakistan's lower order falling cheaply was disappointing'
Sri Lanka took the last eight wickets in just 23.4 overs to secure a series-levelling win in Galle
Jayasuriya: 'I gave my everything to play for Sri Lanka'
Left-arm spinner opens up about his struggles after picking up 29 wickets in his first three Tests