Jos Buttler and Ben Stokes rode their luck during a vital partnership as England stretched their lead to 306 on the third afternoon of the final Test against Sri Lanka.
The pair came together at 39 for four but quelled the prospect of collapse in Colombo, adding 89 before both fell in the afternoon session as England reached tea on 210 for seven.
Their stand hinged on several instances of good fortune, with Stokes particularly fortunate to make 42 after twice being caught off Lakshan Sandakan no-balls.
Buttler's 64 was a more secure knock by some distance but he still had to overturn an lbw verdict which looked plumb in real time and saw a tough chance dropped at the wicket on 38.
England began 99 in front but lost both openers cheaply. Keaton Jennings succumbed lbw to the first ball of the day, Dilruwan Perera willing a wicket-to-wicket delivery into the front pad, and Rory Burns fell for an identikit dismissal.
Perera needed some assistance to add first-innings centurion Jonny Bairstow to his collection, with Kaushal Silva on hand to hold a firm chance at short-leg, and when captain Joe Root fed a leading edge back to left-armer Malinda Pushpakumara just nine balls later England appeared to be in a tailspin.
Stokes and Buttler tipped the scales back in their side's favour, knocking Sandakan off his length with the wrist spinner releasing the pressure with two costly overs.
Sri Lanka could scarcely believe their fate when Sandakan's wandering front foot twice cost them, Stokes summoned back to the middle on 22 and 32, while Buttler gambled and won after being given lbw.
He had 27 when Dhananjaya De Silva wrapped him on the knee roll in front of middle only for ball-tracking to show it skipping over the top. When Niroshan Dickwella spilled a thin edge down leg-side from the first ball after tea, the fates appeared to be conspiring against the hosts.
Stokes' luck eventually expired when he failed to clear long-on off the probing Perera but Buttler continued to nudge, push and steer his way to a busy half-century that featured almost none of the fireworks he is known for.
He had used his feet adroitly throughout but eventually ventured too far, stumped as Sandakan dragged one down leg side. Sri Lanka needed England's resistance to go with him but Moeen Ali (22), Ben Foakes (20no) and Adil Rashid (21no) continued adding to their forthcoming chase.