Ben Stokes provided yet more heroics and his bowlers crucial late wickets as England desperately battled to keep their Ashes hopes alive on day two of the third Test at Headingley.
In an innings reminiscent of his famous knock on the same ground four years ago, Stokes' 80 dragged his side from 142-7 to 237 all out before Australia slipped to 116-4, 142 ahead, at the close.
Stokes' knock meant the tourists' first-innings lead was just 26, despite four wickets falling in the morning session - including Joe Root with the second ball of the day to Pat Cummins, who claimed 6-91.
The England captain attacked after lunch, launching five sixes and six fours, while Mark Wood helped swing the momentum with 24 from eight balls.
In reply, despite the loss of David Warner for one, the opener again caught off Stuart Broad, Australia eased to 68-1 and a lead of 94 as they threatened to take a firm grip on an enthralling Test.
But Moeen Ali removed Marnus Labuschagne and Steve Smith in successive overs before Chris Woakes dismissed Usman Khawaja in the final hour for 43.
Travis Head and first-innings centurion Mitchell Marsh survived the final 45 minutes to leave the Test, in which a win would seal the series for Australia, finely poised.
England stay in the contest
England are already attempting to do what they have never done before - overturn a 2-0 deficit to win the Ashes - and at times on a captivating second day their hopes were fading.
But in Stokes they have a player at his best when his back is against the wall, shown in his incredible 155 in last week's second-Test defeat and in his iconic, match-winning 135 not out at Headingley in 2019.
England resumed on 68-3 but by lunch they had just three wickets left and were still 121 runs in arrears, only for their captain to almost drag them to parity - all while struggling with a glute injury.
That injury prevented Stokes from bowling and, with Ollie Robinson also out of the attack with a back spasm, England were struggling when Khawaja and Labuschagne blunted the new ball.
England stuck to their task, though, on a pitch offering less movement and pace than on day one.
The presence of Marsh and Head, two batters who can score quickly, is a danger, but Headingley is the best Test ground in England to bat in the fourth innings.
In the past three fourth-innings chases at the ground 359, 322 and 296 have been made to win, while Leicestershire knocked off 389 here in county cricket earlier this summer.
Stokes fights through the pain
Stokes arrived at the crease when Root got a ball from Cummins that bounced, took the edge and was snaffled by Warner at first slip.
Within the first half hour, Bairstow edged a full ball to Smith from Mitchell Starc when attempting a slashing drive.
Stokes was patient in the morning session, sharing watchful partnership of 44 until Moeen fell into the short-ball trap and was caught at fine leg for 19.
The England captain watched from the non-striker's end as Woakes was hit on the head by a Starc bouncer, responded by a clubbing another for six but was then inevitably caught behind on the pull via a thin edge.
Wood was the unlikely instigator of England's counter-attack. He smacked Starc for six first ball and cleared the rope twice more in eight balls before Stokes flicked the switch.
Again he hogged the strike to put on 32 with number 10 Broad and 38 with last man Robinson as he smashed Ashes debutant Todd Murphy for five sixes, including one huge straight hit into the top tier.
Stokes offered two tough chances in successive balls while on 45 - Starc spilling a running catch from long-off and spinner Murphy a caught and bowled - but was finally dismissed after slicing another heave into the hands of Smith at long-on.
Labuschagne & Smith hand England opening
The rate at which England lost wickets and scored runs meant their bowlers had little more than 50 overs of rest before taking to the field again, the injuries only adding to their woe.
But the early boost came when Warner nicked Broad to second slip, the 17th time he has been dismissed by the England seamer in Tests, to leave Australia 11-1.
On 33, Labuschagne offered a chance down the leg side when attempting to pull Wood but, diving one-handed, Bairstow spilled his third chance of the match.
England's wicketkeeper would have been relieved when the right-hander slog-swept his next ball straight into the hands of Harry Brook at deep mid-wicket.
If that wicket was an unexpected gift, the next was even more so. Smith, usually immovable, simply clipped Moeen to mid-wicket to hand England's off-spinner his 200th Test scalp - Bairstow sending Smith on his way with a word from behind the stumps.
Wood, who bowled quickly again but slightly slower than on day one, looked exhausted when he made way after a testing spell.
He was replaced by Woakes, who tempted Khawaja into a poke for a crucial late breakthrough courtesy of a decent edge through to Bairstow.
That put England on top but Marsh, more restrained than in the first innings, and left-hander Head ensured the Test remains perfectly in the balance.
'A tremendous battle' - reaction
BBC cricket correspondent Jonathan Agnew on Test Match Special: "A fascinating game of cricket, all the players out there have given absolutely everything and it has been a tremendous battle.
"Can England keep the Ashes alive? At the moment, it's well within their grasp."
England all-rounder Moeen Ali: "I'm really glad I came back to Test cricket. Playing under Stokes and Brendon - even when bowling I don't feel under pressure. The environment is my sort of environment for sure."
Former England captain Michael Vaughan: "It's fantastic to watch, you just don't know which way it is going to sway.
"Ben Stokes is just remarkable - whilst there was carnage around him he just had clarity."
Australia captain Pat Cummins: "I'm sure the fans are loving it but I wouldn't mind a stress-free day or two. It's all set up for another wonderful match."