New Zealand captain Kane Williamson played one of the great World Cup innings to steer his side to a tense four-wicket victory over South Africa.
Needing eight to win from the final over, Williamson swept the second ball for six to complete a majestic century.
And he sliced the next away for four to see the Black Caps past their target of 242 with three balls to spare.
He was aided by Colin de Grandhomme's superb 60 off 47 balls after the Kiwis had slipped to 137-5.
South Africa, who are now effectively eliminated, squandered chances to remove both during an absorbing finale, including failing to ask for a review before replays showed Williamson had nicked Imran Tahir behind to Quinton de Kock on 76.
De Grandhomme was caught at long-off trying to hit the first ball of the penultimate over for six but the unflappable Williamson took his side home, ending unbeaten on 106.
With the match reduced to 49 overs per side because of a wet outfield that delayed the start of play by 90 minutes, South Africa posted 241-5 following Rassie van der Dussen's 67 not out and Hashim Amla's scratchy 55.
Their circumspect approach on a tricky two-paced pitch was not quite enough though, with a fourth defeat in six matches leaving South Africa all but out of contention for the semi-finals.
New Zealand remain unbeaten, with four wins and a no result in their five games so far, and move back to the top of the table.
Williamson came to the middle after just 13 balls of New Zealand's innings and proceeded to show supreme concentration for 138 deliveries on a testing surface against a talented South Africa attack to drag his side over the line.
With scoring difficult, he deftly opened the face of the bat to guide to third man - doing so to hit a crucial four off the last ball of the 48th over - and clipped through mid-wicket, his six off Andile Phehlukwayo to tie the scores perhaps his only truly expansive shot.
At one point he completely lost his timing and was given two huge reprieves by South Africa - a late cut off Tahir's final delivery produced a thin bottom edge through to De Kock, which Proteas skipper Faf du Plessis only discovered after the match, while Kagiso Rabada and David Miller flunked a clear chance to run Williamson out shortly after.
But nothing fazed Williamson and once Mitchell Santner got him back on strike with seven needed from five balls, he duly delivered, bringing up his 12th ODI century and first in a World Cup. An unassuming man had just done something very special.
De Grandhomme's knock was similarly vital, the all-rounder getting the measure of the pitch quicker than any other batsman, which he combined with impressive power in hitting five fours and two sixes.
The Kiwis had earlier looked in control of the chase at 72-1 only for the freak dismissal of Martin Guptill - his right foot sliding back to hit his own wicket as he pirouetted after a pull shot - to bring about the loss of three wickets for just 12 runs.
Jimmy Neesham made 23 to help Williamson stabilise before he cut to Amla at wide first slip off Chris Morris (3-49), setting up a nail-biting run in and arguably the best match of the World Cup so far.
With New Zealand struggling to score in reply, South Africa's effort looked much more respectful than it had done at the time, but ultimately they paid for a slow start.
Opener Amla is an all-time great player but has had a poor World Cup and was pedestrian again, leaving 11 balls in the first 10 overs.
Signs of class remain - he hit Trent Boult for two consecutive fours with two gorgeous drives - but after grinding his way past 50, he fell playing inside a superb Santner delivery that turned and hit the top of off stump.
Amla's approach required others to kick on around him but the top four all ended with a strike-rate of under 70, and Van der Dussen and Miller (36) were on course to do the same until some fine late hitting added 72 in the last 10 overs.