Sri Lanka, set an improbable victory target of 461 and two days to bat, slumped to 98-3 at lunch on day four, still 364 runs behind.
Resuming at 15-0, Sri Lanka's openers batted out the first hour of the session without any trouble but England's patience paid off when Jack Leach made the breakthrough when Kaushal Silva attempted a sweep and was adjudged lbw for 30.
Moeen Ali took a return catch to dismiss Dimuth Karunaratne for 26, giving the England spinner his 150th test wicket and making amends for a chance that went down off his bowling when the Sri Lanka opener was on 16,
Ben Stokes made a vital breakthrough on the stroke of the interval when he had Dhananjaya de Silva (21) cauth at slip by Joe Root one ball after his strong appeal for a caught-behind decision was rejected by the TV umpire.