England were closing in on victory over a gritty Sri Lanka in the first test with the visitors on 204-6 in their second innings at the end of the third day at Old Trafford on Friday - a slender lead of 82.
Angelo Mathews (65) and Kamindu Mendis (56 not out) led a stubborn rear-guard action as Sri Lanka managed to wipe off the 122-deficit from the first innings.
England, however, who were earlier bowled out for 358 with Jamie Smith making his maiden test century, will be odds on to take the lead in the three-match series on Saturday.
Starting a windy day with a 23-run lead with four first-innings wickets left, Smith moved from 72 not out to 111 off 148 balls, the 24-year-old becoming the youngest wicketkeeper to score a test hundred for England.
Gus Atkinson departed on 20 after being caught behind for debutant fast bowler Milan Rathnayake's first test wicket and Smith went three overs later as wicketkeeper Dinesh Chandimal did well to hold on to a slight edge on a wide delivery from left-arm spinner Prabath Jayasuriya.
Tail-enders Mark Wood and Matthew Potts then shared a stand of 33 to build England's lead.
Sri Lanka, given a few overs to bat before lunch, made a dreadful start as Nishan Madushka was bowled by Chris Woakes for a duck before Atkinson had Kusal Mendis caught behind by Smith, also without scoring to leave on one for two.
Mathews dug in after lunch though as Sri Lanka edged towards parity but the visitors fell to 95 for four with Dimuth Karunaratne dismissed by Wood for 27 and captain Dhananjaya de Silva falling lbw to Matthew Potts.
With Chandimal also retired hurt after a blow to the thumb off a fierce Woods delivery, Sri Lanka were in deep trouble.
But Mathews proved obdurate as he and Mendis managed to get Sri Lanka into the lead with a partnership worth 78.
A ball change revitalised the England attack and Mathews eventually got a leading edge off the bowling of Woakes and was caught by a diving Matthew Potts at point before Milan Rathnayake was caught in the deep for 10.
A battling Kamindu Mendis was still there at stumps, joined by the returning Chandimal who had earlier gone to hospital to have X-rays on his thumb, tests apparently showing no fracture.
Chandimal thumped spinner Shoaib Bashir for a boundary off the last ball of the day and Sri Lanka will need similar fight on day four to stand any chance of setting defendable total.