Sri Lanka 336 (Silva 85, Karunaratne 63, de Silva 59, Leach 3-70, Rashid 3-76) and 219 for 5 (Mathews 88, Leach 4-73) need another 75 runs to beat England 290 (Curran 64, Buttler 63, Dilruwan 4-61) and 346 (Root 123, Foakes 65*, Burns 59, Dananjaya 6-115)
Kandy: England put themselves on the brink of victory in the second Test and the series against Sri Lanka before rain brought an early end to day four.
Set 301 to win in Pallekele, the hosts recovered from 26-3 to reach 221-5 thanks to Angelo Mathews.
But the tourists struck twice in quick succession after tea to remove Mathews for 88 and Dilruwan Perera for two, leaving Sri Lanka 226-7 and needing a further 75 for victory.
England lead the three-Test series 1-0.
Sri Lanka fought back admirably after Jack Leach took three early wickets as England's spinners struggled to apply consistent pressure.
But Moeen Ali's lbw dismissal of Mathews should mean England wrap up victory on Sunday to claim their first series win in Sri Lanka since 2001 and their first away from home under captain Joe Root.
The final day will start 15 minutes earlier than scheduled at 09:45.