England 421 and 38 for 3 (Embuldeniya 2-13) need 36 more runs to beat Sri Lanka 135 and 359 (Perera 62, Thirimanne 111, Mathews 71, Leach 5-122, Bess 3-100)

It may look like a modest target, but England face a nervous final morning in their bid to wrap up victory in the first Test against Sri Lanka in Galle.

When Sri Lanka's second innings ended, midway through the final session on day four, it seemed the result was little more than a formality. England had been set just 74 to win, after all.

But within minutes, England were 14 for 3. The left-arm spin of Lasith Embuldeniya, in particular, appeared to send panic coursing through the England line-up with Joe Root, their captain, run out by yards as he attempted to complete a highly optimistic single.

By then, England had already lost both openers. Dom Sibley, desperate not to be drawn into playing at one that left him, instead left a straight ball that hit his off stump. Zak Crawley, meanwhile, was unable to capitalise upon being dropped on one, pushing at one that did indeed turn away from him and presenting a sharp catch to gully.

But it was only when Root fell that Sri Lanka would have sensed they could pull off one of the great comebacks. Jonny Bairstow had barely dropped the ball more than a couple of metres in front of him, but seemed to call Root through for a single that was as unnecessary as it was unlikely. He had collided with the bowler, Dilruwan Perera, but was left well short of his ground regardless, as the keeper, Niroshan Dickwella, broke the stumps with his direct hit.

Had Bairstow, looking more than a little rattled, been run out to the next delivery - he attempted another impossibly quick single and would have out by yards if there had been a direct hit - Sri Lanka might even have been favourites.

But he survived. And in partnership with an impressively calm Dan Lawrence, Bairstow added 24 more runs before bad light forced a slightly early close. You suspect, ultimately, that the damage incurred in Sri Lanka's first innings will simply prove too deep to mend. That said, England still require another 36 to win on the final day, and as the first six overs of their innings showed, it would be wrong to take anything for granted.

If England do go on to win, it will prove an especially memorably performance for Jack Leach. Leach, who came into this game having played just two first-class games in the last 14 months, has endured a tough time since he last represented England in Mount Maunganui in November 2019. He fell ill on that tour of New Zealand and was subsequently hospitalised with a case of sepsis that he admitted had him fearing for his life.

While he was recalled to the England squad for the tour of South Africa, he fell ill once again and was eventually sent home early to ensure a complete recovery. With the outbreak of Covid-19 adding to the concerns of a man with a reduced immune system (a courtesy of his long-term battle with Crohn's disease), Leach has admitted there were moments when he wondered if he would ever return the Test team.

So to complete a five-wicket haul - his second at this level and his first since England last toured Sri Lanka in 2018 - represents a remarkable comeback. And a further demonstration of the strength of character that lurks under that mild-looking exterior.

In truth, neither Leach nor Dom Bess was at their best for much of this game. Lacking the preparation they would have liked, there were times when they were unable to harness the undoubted assistance provided by this surface. Both would confess they bowled more release deliveries than they would have liked.

Increasingly, however, they started to find their rhythm on the fourth day. There were moments in Sri Lanka's second innings when Leach, in particular, looked a dangerous proposition with his drift and turn troubling the right-handers.

The wicket of Perera might have been particularly pleasing for England. It saw Jos Buttler complete the first stumping of his Test career to underline a really accomplished performance with the gloves. Buttler, in his 28th Test as keeper, had earlier missed a desperately tough stumping opportunity, but has generally kept impressively in this game. Completing such a dismissal from his old friend, Leach - the pair developed together at Somerset - was due reward for his improvement. And it will please the selectors, who have preferred him to Ben Foakes, who was player of the series when England won here in 2018.

There were also moments it appeared Sri Lanka could set England a testing fourth-innings target. Certainly when Lahiru Thirimanne was at the crease, Sri Lanka will have retained thoughts of repeating their remarkable performance here in 2015, when they overcame a huge first-innings deficit to bowl India to defeat in the fourth innings.

Thirimanne's only other century at this level came on this ground in March 2013. But, since that match against Bangladesh, he had averaged 19.16 in 27 Tests coming into this game. Having failed in the first innings, it is no exaggeration to suggest that, by the time he walked out to bat on the third day, his career - and Sri Lanka's hopes of salvaging anything from this game - were hanging by a thread.

But he revived his side's hopes with an impressively assured contribution in the innings. Showing both patience and composure, he demonstrated a decent defensive technique and put away the loose ball effectively in reaching his first century in 54 Test innings.

Each time it seemed Sri Lanka were on the brink of establishing a strong position, however, England would claim the wicket that pulled them back into the mire.

In the end, it was the new ball that did for Thirimanne. After Sam Curran had moved a couple away from him, he got one to hold its own and take the inside edge of Thirimanne's bat. Shortly afterwards, Dinesh Chandimal was drawn into poking at one from Bess that went straight on.

Still, by the time they reached parity, Sri Lanka still had five wickets in hand. In partnership with Dickwella, Mathews had negotiated a disciplined spell from England's seamers to add 48 overs in 23.4 overs.

That frustration may well have led to Dickwella's downfall. Attempting to run a short ball to third man, he succeeded only in top-edging the ball into the gloves of Buttler. In the next over, Dasun Shanaka was beaten in the flight by Leach and effectively yorked before Wanindu Hasaranga was drawn into a drive and Root held onto a sharp chance at slip.

While Mathews reached a determined half-century, he was unable to replicate his heroics of Leeds in 2014 and became the final man to fall after edging one that left him from the deserving Leach. It was a performance that gave Sri Lanka just a scintilla of a chance. You cannot help but wonder, however, what might have happened had they managed even 50 or 100 more in their first innings.

George Dobell is a senior correspondent at ESPNcricinfo