Sri Lanka rattled England with three quick wickets late on the fourth day of the first Test in Galle on Sunday, but the visitors remained favourites to win the match with just 36 more runs needed and seven wickets in hand.
England were expected to comfortably close in on a victory after Jack Leach took 5-122 with Sri Lanka all out for 359 in their second innings, leaving the visitors needing only 74 to win.
But Sri Lanka struck early, with Dom Sibley (2) and Zak Crawley (8) falling to left-arm spinner Lasith Embuldeniya. Captain Joe Root was run-out for one after a mix-up with Jonny Bairstow.
Bairstow and Dan Lawrence, who was making his debut, took a nervous England to 38-3 as bad light brought an early end to proceedings at Galle International Stadium.
Earlier, left-armer Jack Leach tightened the noose around the hosts with a five-wicket haul while off-spinner Dom Bess claimed three wickets.
Sri Lanka were bundled out for 135 runs in their first innings.
Angelo Mathews struck 71 after hitting his 36th half century in Tests to hold fort at one end after opener Lahiru Thirimanne made 111 to steady the innings.
This was Thirimanne's second hundred of his Test career and his first in seven years.
England, who made 421 in their first innings on the back of a fine double century by Root, had struck in the first over after lunch, with Bess having Chandimal caught at first slip.
Mathews stitched a 48-run partnership with Dickwella before the wicketkeeper-batsman nicked one behind off Bess.
England took a review against Mathews after the on-field umpire ruled not out to an lbw appeal from Bess. However, replays showed the ball was missing the stumps.
Leach said his haul was hard-earned but that he was glad to get some wickets on his return to Test cricket after 14 months.
"I felt actually my pace needed to be a little bit quicker. I think this morning I felt I probably didn't bowl at great pace and therefore it was easier for them to get back and create room for themselves," the Somerset bowler said.
"I reflected on that. And when I was to return, I felt I wanted to bowl a little bit faster and more direct, I guess, at the area I was trying to bowl."
Leach suffers from Crohn's Disease and had a bad run with illnesses during England's winter tours of New Zealand and South Africa. He said he was feeling tired and sore after the day's exploits.
"I guess I'm gonna need to rest up but you know, I'm just taking a day at a time, taking a game at a time," he added.
"So you know, I guess something I've learnt is you never know what's around the corner, so I'm just try to enjoy each day and see what happens really."
The match is being played in an empty stadium due to Covid-19 restrictions.