The first test between England and Sri Lanka was sliding inexorably towards a draw on Monday, with the tourists still 226 runs short of an unlikely victory on the final day at Lord's.
Captain Alastair Cook set Sri Lanka 390 to win in 90 overs after declaring England's second innings on their overnight score of 267 for eight.
After losing opener Dimuth Karunaratne for 16 before lunch, Kumar Sangakkara and Kaushal Silva put on 98 for the second wicket before the latter fell for 57, his second half-century of the match.
Mahela Jayawardene was then removed for 18, with Sangakkara (59 not out) and Lahiru Thirimanne (0 not out) seeing Sri Lanka through to 164 for three at tea as they added just 65 runs in the middle session.
Karunaratne fell after another breezy but ultimately short-lived innings when he failed to deal with Stuart Broad, edging into his body before Sam Robson claimed a sharp chance at short leg.
The diminutive Silva held his nerve in the face of some well directed bouncers from Liam Plunkett to add to his first-innings 63, before gloving Chris Jordan through to keeper Matt Prior down the leg side while attempting a flick off his hips.
Jayawardene also came in for a short-pitched examination from Plunkett, who has displayed good speed in his first test in seven years, but eventually went to Anderson as he feathered an edge through to Prior.
Sangakkara, who has now passed 50 in his last six test innings, went 31 balls without scoring at one stage during the afternoon session.
Barring a dramatic collapse, however, Sri Lanka are likely to head into Friday's second and final test at Leeds with a draw behind them.