England withstood a gutsy Sri Lankan fightback as seven wickets of spin and two magical moments from Keaton Jennings brought them within sight of a series-clinching victory in Kandy.
Rain prevented the second Test reaching a conclusion on day four but with the home side 226 for seven and needing 75 runs to force a decider in Colombo, England will resume as firm favourites.
If they finish the job, and not out batsman Niroshan Dickwella will do his best to ensure they do not, it will be just reward for Jennings' inspired work at short-leg and a second consecutive triumph for their trio of tweakers – Jack Leach, Moeen Ali and Adil Rashid.
[On this PAGE an item was removed from that AMP version click for the full mobile version.]
[On this PAGE an item was removed from that AMP version click for the full mobile version.]
It was as brave as it was brilliant and deserved to be part of a winning effort.
Ordinarily it might even have been enough to persuade Sri Lanka it was not their day but Mathews, dropped by Ben Stokes on seven from a taxing slip chance, was defiant.
Having started the job of grinding England down alongside Karunaratne, he brushed off Jennings' jaw-dropping intervention to go again alongside Roshen Silva.
This time the stand was worth 73, more crucial runs against a softening ball on a slowing pitch.
Mathews reached his half-century in 75 balls, a relatively brisk effort given he hit only three boundaries in that time.
Instead he watched the ball diligently, played it late where he could and made the most of gaps in the field.
In an elongated afternoon session Sri Lanka added 126 for the loss of two wickets, with England's lengthy pursuit of Roshen ultimately boiling down to their use of DRS.
[On this PAGE an item was removed from that AMP version click for the full mobile version.]
The first was frivolous, Rashid's lbw appeal pitching outside leg and missing the stumps, the second a missed opportunity.
Moeen had the batsmen pinned on leg stump but, perhaps concerned about height, England chose not to send it upstairs.
Third time proved a charm, Joe Root making the signal after his slip catch was waved away. Replays showed a slight inside edge before the ball looped off the pad and the fifth wicket was safely banked.
The relief was fleeting as Dickwella flashed a run-a-ball 23 in the minutes leading up to tea.
During the interval things looked bad for England, but it took just three balls after the restart for Moeen to straighten one from round the wicket and claim the prize scalp of Mathews.
Leach followed by picking off Perera just before a storm moved into view and deferred the finale until day five.