England were three wickets from losing their first home Test series against Sri Lanka at tea on day five at Headingley.
The hosts had started the day on 57 for five chasing a notional 350, the tourists having run riot on the fourth evening, but put in a much-improved showing to reach 177 for seven with a session of the decisive second Investec Test remaining.
Even so the wickets of Joe Root, for a diligent 31, and Matt Prior (10) gave Sri Lanka a way into the tail while Moeen Ali stood firm on 56 not out.
The morning's play was everything the previous session was not, and was all the better for it from an English point of view.
Where the tourists had been rampant in the previous session, Dhammika Prasad an unlikely bogeyman picking off four top-order batsmen, here they were flat and uninspired.
While England ended day four in a tailspin, they started day five with clear minds.
Root was conspicuously defensive, scarcely offering a shot and rarely being forced to, with Moeen more ready to take runs when they were on offer.
Over 17.4 overs, Root scored just three runs in 42 deliveries while Moeen managed 22 - including three boundaries off a noticeably tamer Prasad.
The rain came at 83 for five, first in showers and then heavily enough to force an early lunch at 12.30pm.
No overs were lost as a result and when the sides returned an hour later, things became considerably edgier in the middle.
Away captain Angelo Mathews appeared to be the instigator, using a break in play to launch some verbals in the direction of Root.
A period of sledging had been promised by Mahela Jayawardene, who suggested England struggled to deal with pressure, but Root did not take a backward step.
He offered a few words of his own to Mathews as tensions simmered enough for the umpires to step in at least twice to call for cooler heads.
Sri Lanka's bowlers then indulged themselves in a period of aggressive short-pitched bowling, though whether it was by tactical design or personal antipathy towards the Yorkshireman was unclear.
Either way, Shaminda Eranga succeeded in clattering Root clean on the helmet as well as forcing a couple of awkward fends away from the body.
Moeen was enjoying a more low-key time, with no real sledging and no threat to his wicket as the 50 partnership came up in 161 balls.
With 18 in 95 balls Root suddenly emerged from his shell, striking three boundaries in 10 deliveries, but his improved confidence may have contributed to his downfall.
Root was tempted by Nuwan Pradeep to flick one off his legs but was straightened up and saw a leading edge carry to Lahiru Thirimanne in the gully.
Moeen's resistance continued with new man Matt Prior, with the all-rounder taking advantage of attacking fields with a couple of crisp fours off Herath.
A gentle single brought his half-century in 129 balls and he survived the double jeopardy of a DRS review against Herath that covered a leg-slip catch as well as an LBW.
Prior offered solid support for 15 overs but was undone when Prasad dug one at his ribs.
Just as he did against Eranga at Lord's, Prior got in a tangle and diverted the ball to short leg where Kaushal Silva held a low chance.
It briefly looked as if a no-ball might save him, but a margin call went with the bowler.