Ryan Sidebottom took a hat-trick on the fourth evening to bowl England back into the first Test against New Zealand.
Sidebottom removed Stephen Fleming, Matthew Sinclair and Jacob Oram with consecutive deliveries to become the 11th Englishman to achieve the feat in a Test.
New Zealand collapsed from 55-1 to 147-8 during an incredible final session and lead by just 269 heading into a final day in which both sides harbour victory ambitions.
Sidebottom (5-37) had already accounted for both openers prior to his hat-trick, while Monty Panesar (3-33) also got a piece of the action with the wickets of Brendon McCullum, Ross Taylor and Kyle Mills as New Zealand's attempt to build their advantage quickly backfired.
The match appeared to be meandering towards a draw during the first two sessions. England used the first 39.1 overs of the day to extend their first innings from 286-6 to 348 all out and concede a deficit of 122.
After Matthew Bell was caught behind in the first over of New Zealand's second innings, Jamie How and Fleming looked in total control while adding 98 in 27 overs either side of tea.
Fleming - who is retiring at the conclusion of the series - appeared almost carefree while racing to a 66-ball half-century. His only blemish came when Paul Collingwood (0-20) failed to cling onto a difficult one-handed return catch in the over before tea.
Steve Harmison had given a revealing insight into his recent struggles during an interview with Sky Sports' Nasser Hussain before the start of play. The Durham paceman took 1-97 in the first innings and fared little better during a four-over spell that cost 24 runs and saw him banished to the outfield for the remainder of the day.
New Zealand's collapse was sparked by a superb catch a few yards inside the midwicket boundary by Matthew Hoggard to dismiss How (39). The Yorkshire seamer made good ground backward and to his left before leaping in the air to complete the dismissal and give Sidebottom his second wicket.
The Nottinghamshire left-armer soon added the scalp of his former county captain Fleming (66) for the second time in the match by tempting him to drive a half-volley to Cook in the gully.
And Sidebottom made it two in two with the first ball of his next over, Sinclair (2) was caught in the gully - again by Cook - after driving away from his body. The hat-trick, the first for England since Hoggard in Barbados four years ago, was completed by trapping a lead-footed Oram plumb in front with a full inswinger.
In between Panesar removed Brendon McCullum (0), who had been promoted to number five as New Zealand pressed on with an aggressive approach. The in-form wicketkeeper heaved his second ball high in the air and Andrew Strauss took a well-judged catch at wide mid-on.
Daniel Vettori stood firm in the lengthening shadows with 13 not out, but Panesar (3-33) removed Taylor (6) and Kyle Mills (11) late in the day to ensure the momentum remains with England heading into the final day when the they will be optimistic of chasing anything under 300.
That had looked an unlikely scenario during a morning session in which England continued their safety-first policy after resuming their first innings on 286-6. They added 61 runs for the loss of just Collingwood to reach lunch at 347-7.
Collingwood (66) became the first batsman to be given out lbw in the match when, in the 26th over of the morning, Oram (1-27) sneaked an off-cutter onto his back pad and convinced umpire Daryl Harper to raise the finger. His dismissal ended a seventh-wicket partnership of 90 with Tim Ambrose.
England did not last long after lunch, losing their final three wickets in 7.1 overs for the addition of just one run.
Off-spinner Patel (3-107) claimed two of those with consecutive deliveries in the first over of the session, Ambrose and Harmison both caught by Fleming at slip.
Ambrose's promising debut innings ended on 55 with a regulation outside edge, while Harmison (0) top edged an ambitious sweep at his first ball.
Last-wicket pair Sidebottom and Panesar then batted out five maidens in the next six overs before Mills trapped Panesar lbw with the third new ball to finish England's first innings - which began on the second day and spanned 173.1 overs - at 348.