England 421 (Root 228, Lawrence 73, Dilruwan 4-109) and 38 for 3 (Embuldeniya 2-13) need another 36 runs to beat Sri Lanka 135 (Bess 5-30) and 359 (Thirimanne 111, Mathews 71, Perera 62, Leach 5-122)
Galle: England need 36 runs on the final day to win the first Test against Sri Lanka despite losing three wickets in a chaotic end to the fourth day in Galle.
Chasing only 74, the tourists slipped to 14-3 as Dom Sibley and Zak Crawley fell to left-arm spinner Lasith Embuldeniya before captain Joe Root was run out for one after a mix-up with Jonny Bairstow.
Bairstow, who survived a run-out chance of his own, and debutant Dan Lawrence saw England to 38 without further loss before bad light ended play early.
Bairstow and Lawrence will resume on 11 and seven respectively when play resumes at 04:15 GMT on Monday.
Earlier, Sri Lanka were bowled out for 359, with Lahiru Thirimanne scoring 111 - his first century for almost eight years - and Angelo Matthews 73.
Jack Leach, playing his first Test since 2019, took 5-122 and Dom Bess 3-100 to finish with match figures of 8-130 and set up what should still be a comfortable victory despite a wearing pitch.
England won their most recent series in Sri Lanka 3-0, but their record in Asia, and playing spin, is poor and it reared its head again in a remarkable start to their fourth-innings chase.
Sibley, whom many feel is vulnerable against spin, was bowled for two not offering a shot, while Crawley, who was dropped on one, had made eight when he was superbly caught at gully by Kusal Mendis as he attempted a drive.
England contributed to their own problems as captain Root, who scored a magnificent 228 in the first innings, was run out by a direct hit by wicketkeeper Niroshan Dickwella, colliding with bowler Dilruwan Perera after Bairstow called for a risky single.
Bairstow and Lawrence restored calm in a 24-run stand to steer England to stumps, and they remain firm favourites to take a 1-0 lead in the two-match series.