Jonny Bairstow's second century of the series helped England avoid a possible collapse on day one of the third Test with Sri Lanka at Lord's.
England have already won the series after victories in the first two matches but Sri Lanka appeared poised to take command of the finale on Thursday as the hosts slumped from 56-0 to 84-4.
But Bairstow and Alastair Cook, whose 85 saw him surpass Sunil Gavaskar on the list of all-time Test run scorers, rebuilt the England innings with a fine fifth-wicket partnership of 80.
Cook was denied a three-figure score but Bairstow, who scored 140 in the first Test at Headingley, took advantage of a series of let-offs to post the third Test ton of his career as England closed on 279-6.
Alex Hales fell after a promising start to the England innings, the opener unable to build on scores of 86 and 83 at Headingley and Durham, going for just 18.
Nick Compton (1) soon followed in what could be his last Test following a disappointing series, with Suranga Lakmal (2-66) backing up that wicket by trapping Joe Root (3) lbw.
Cook set a new record as he passed the 50 mark for the 13th time in Tests at Lord's but England were teetering when James Vince (10) had one of his bails trimmed off by Nuwan Pradep (2-79).
However, Bairstow's arrival at the crease tilted matters in England's favour, although the tourists were unfortunate not to dismiss the Yorkshire right-hander on more than one occasion.
The wicketkeeper-batsman was dropped at midwicket on 11 by Shaminda Eranga, but Sri Lanka did claim the wicket of Cook, Pradeep striking for the second time shortly before tea.
A half century arrived soon after the resumption for Bairstow, who continued by the beneficiary of luck, surviving a number of edges and a lbw review despite a delivery from Eranga that would have gone on to hit leg stump.
Moeen Ali had looked in good nick only to be dismissed for 25 but Bairstow - who ended the day unbeaten on 107 - maintained his fluent form as he and Chris Woakes (23 not out) combined well.
Bairstow brought up his hundred with a pushed single through backward square leg, registering his maiden century at Lord's on another enjoyable day in a dominant series for England.