Galle: England's top order stumbled on a turning wicket after Sri Lanka wiped out a huge deficit and setup a tricky target of 74 runs on the fourth day of the first Test on Sunday.
Left-arm spinner Lasith Embuldeniya grabbed 2-13 and first innings double century-maker Joe Root was brilliantly run out by Niroshan Dickwella for 1 as England went to stumps on a nervy 38-3.
Jonny Bairstow, who also escaped a run-out, was unbeaten on 11 while debutant Dan Lawrence was not out on 7 as England still needed 36 for victory.
Sri Lanka had earlier defied England spinners through Lahiru Thirimanne's (111) first test century in almost eight years and a fighting 71 off 219 balls by Angelo Mathews to reach 359.
Left-arm spinner Jack Leach (5-122) got a five-wicket haul and offspinner Dom Bess (3-100) finished with eight wickets in the game, but Mathews dug in well against both spinners to push the match into the final day.
It was a remarkable turnaround in batting form of the home team, which was skittled out for just 135 in the first innings before Root's 228 had led England to a daunting 421 and gave the visitors a meaningful 286-run lead.
Sri Lanka was just 10 runs ahead when it lost its seventh wicket on 296, but Mathews was well supported by No. 10 batsman Dilruwan Perera (24) to stretch the lead to 73.
England had its chances, but Jos Buttler missed a difficult stumping when Mathews was on 58 while Bairstow couldn't hold onto a sharp low catch close to the wicket before Perera had scored.
Buttler, playing in his 48th test match, finally got his first stumping in the five-day format when he had Perera before Leach grabbed his second five-wicket haul against Sri Lanka when Mathews finally edged to Root in the lone slip.
The 87-Test veteran Mathews, who came to the crease in the second over of the day, batted for five hours and 44 minutes to raise his 36th test half century and hit four boundaries.
Bess had struck twice in the middle session when he had stand-in captain Dinesh Chandimal caught in the slip in the first over after lunch.
Dickwella (29) added 48 runs with Mathews before playing a loose cut against the offspinner and got a thick edge to wicketkeeper Buttler before Leach clean bowled Dasun Shanaka (4) with a full-pitched delivery that went underneath the bat to hit the stumps.
Earlier, Thirimanne's patient century, spanning just over six hours and featuring 12 fours, carried Sri Lanka to 242-4 at lunch after the home team resumed on 156-2.
Sam Curran (2-37) provided the much-awaited breakthrough when he got the inside edge off Thirimanne's bat from a delivery that nipped back into the left-hander.
Read More | Thailand Open: Marin, Axelsen win singles titles in Bangkok
Mathews, who was dropped on 11 at forward short leg, reached his second slowest fifty in test cricket off 164 balls in the second session before England struck through its spinners.
But Thirimanne, who wouldn't have played had regular captain Dimuth Karunaratne recovered from a thumb injury, grabbed the opportunity with both hands on a difficult wicket where the ball was spinning.
He put in a determined effort against spinners and fast bowlers alike in raising only his second Test century in his 37th test.
England's spinners had created opportunities to dismiss Thirimanne after Bess had removed overnight batsman Lasith Embuldeniya for nought in the second over when the batsman played a loose shot to short extra cover.
Bess twice came close to claiming the wicket of Thirimanne, who resumed on 76. First Dom Sibley dived full length for a catch at short extra cover but the ball raced to the boundary and then a top-edged slog sweep landed in no-man's land.
Thirimanne reached his hundred off 227 balls with a square cut boundary off Bess. It was Thirimanne's first test hundred in 54 test innings since he scored 155 not out against Bangladesh at the same venue in March 2013.