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.
|South Africa 241-6 (49 overs): Van der Dussen 67*, Amla 55|
|New Zealand 245-6 (48.3 overs): Williamson 106*, De Grandhomme 60|
|New Zealand won by four wickets|