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.
A tea score of 219 for five probably made Sri Lanka slight favourites to reel in their target of 301 but in the 3.2 overs which followed they lost Mathews, Dilruwan Perera and the balance of power.
That they were ever ahead of the game was remarkable from the depths of 26 for three, Leach inflicting serious damage with the new ball.
Opening in place of Sam Curran, off the field receiving treatment on a side strain, he persuaded the hard Kookaburra to turn and bounce past Kaushal Silva leaving Ben Foakes to complete a fine stumping.
When Leach added Kusal Mendis lbw on the sweep, a walkover was on the cards.
Mathews and Dimuth Karunaratne were not about to let that happen and put on a diligent 77 either side of lunch before Jennings produced an even more remarkable effort from under the helmet.
Faced with a full-blooded Karunaratne sweep, he anticipated the stroke and thrust a hand out, improbably but intentionally parrying the ball into Foakes’ gloves.
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.
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.
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.
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.