England defied the rain and a late New Zealand rally to book their place in the semi-finals of the Champions Trophy with a tense 10-run win at Cardiff.
A target of 170 in a game delayed by five hours and reduced to 24 overs per side appeared well within the Kiwis' reach after England lost their last seven wickets for 28 runs.
But the hosts bowled splendidly, especially with the new ball, to restrict New Zealand to 159-8 despite Kane Williamson's valiant 67 off 54 balls.
Although they spent much of the second innings in the ascendancy, England could breathe easily only when Williamson skied Stuart Broad to James Anderson at extra-cover in the 22nd over.
That Broad was millimetres away from being penalised for a no-ball - and some replays suggested he should have been - was typical of a day on which England's hopes of progressing hung precariously in the balance.
As it is, England, as likely Group A winners, look set to face South Africa in the first semi-final at The Oval on Wednesday.
Should Australia beat Sri Lanka convincingly on Monday, England will qualify as runners-up and meet India in the last four at Cardiff on Thursday.
New Zealand will be knocked out unless Australia win - but only by a margin that ensures the Black Caps maintain their superior net run-rate.
A large portion of the credit for England's safe passage must go to Anderson, who claimed two key early wickets and finished with 3-32, while Ravi Bopara - their fifth bowler - numbered the dangerous Brendon McCullum in his haul of 2-26.
The value of Alastair Cook's innings of 64 off 47 balls - albeit one in which he was dropped three times by Nathan McCullum - was also made apparent as New Zealand slipped to 62-5 in reply on a surface that spent much of the day under cover.
Anderson was chiefly responsible for inflicting the early damage, inducing a rash pull from Luke Ronchi that found third man and bowling Martin Guptill via an inside edge two balls later.
The required run-rate had climbed to more than eight an over by the time Ross Taylor failed to overturn an lbw verdict, but that remained a realistic possibility until Brendon McCullum was superbly taken low down at deep square-leg by Joe Root off Bopara, who accounted for James Franklin in his next over.
Williamson, driving and pulling forcibly, and ODI debutant Corey Anderson, who swung merrily, gave England cause for concern with a sixth-wicket partnership of 73 off 45 deliveries.
Broad atoned for an over from Bresnan that cost 19 by ending Williamson's counter-attack, Corey Anderson perished moments later and James Anderson ended an erratic final over by finding Nathan McCullum's edge.
England's innings, which began five and a half hours after they lost the toss, was equally frantic - marked by rash strokeplay and a lack of clear thinking in the latter overs as Kyle Mills's 4-30 saw him become the leading wicket-taker in Champions Trophy history.
Ian Bell had already been reprieved by Franklin when he drilled Mitchell McClenaghan to short extra-cover in the second over, and Jonathan Trott clipped Mills to midwicket shortly after.
A 75-run stand for the third wicket between Cook and Root was far from fluent until Cook launched Franklin back over his head for six then unveiled a ramp shot over the wicketkeeper.
Root perished for 38 as he made room to pull McClenaghan, before Cook offered a return catch to Nathan McCullum to spark England's collapse.
The out-of-form Eoin Morgan followed, lbw sweeping Daniel Vettori, and when James Tredwell steered Mills straight to third man England had gone from 141-3 to 169 all out in the space of five overs.
Thanks to Anderson and company, it was a collapse that did not prove crucial.