Kane Williamson produced a masterclass of controlled batting to lead New Zealand to a tense four-wicket victory against South Africa at Edgbaston on Wednesday, realistically killing off the Proteas' hopes of reaching the World Cup semi-finals.
The Black Caps' skipper kept his cool at the end of a nerve-jangling match that went down to the last over with eight runs still required, hoisting Andile Phehlukwayo for a huge six over midwicket to bring up a majestic century.
He sliced the next ball for four as New Zealand reached their target of 242 with thee balls to spare in a match reduced to 49 overs per side due to a wet outfield.
The close finish in Birmingham was just the tonic the World Cup needed after a string of one-sided results and rain-ruined fixtures sapped the tournament's momentum.
The win puts unbeaten New Zealand top of the 10-team table in the round-robin phase of the competition in England and Wales while South Africa are languishing third from bottom after just one win in six matches.
Williamson, who finished on 106 not out, was helped by Colin de Grandhomme's superb 60 off 47 balls on a tricky pitch after the Kiwis had slipped to 137 for five.
The captain rode his luck when South Africa failed to ask for a review before replays showed he had edged a ball from Imran Tahir to wicketkeeper Quinton de Kock when on 76.
South Africa missed a golden chance to run him out at the start of the 41st over and he was dropped by Lungi Ngidi when on 85, but off a no-ball.
"There's a huge amount to learn from this performance," said man-of-the-match Williamson.
"The experiences that you have by being put under pressure on a number of different occasions, whether it's with the bat or the ball, having close games in tournaments like the World Cup are great to be a part of, especially when you come out on the right side of things."
Earlier, Martin Guptill (35), who had been guiding New Zealand towards their target with a minimum of fuss, trod on his stumps to spark a mini collapse.
Ross Taylor and Tom Latham followed quickly to leave New Zealand struggling at 80-4.
Jimmy Neesham (23) steadied the ship with his skipper but when he was out the Black Caps were plunged back into trouble.
De Grandhomme came to New Zealand's rescue, batting positively and bringing up his fifty off 39 balls but he was caught in the deep by South Africa captain Faf du Plessis off Ngidi in the penultimate over.
Despite the late drama, Williamson kept his cool to see the beaten 2015 finalists home -- they finished on 245-6.
"It's tough now (to progress)," said a disappointed Du Plessis, who felt his side were about 20 runs short when they batted.
"Like you can feel in the dressing room the guys are hurting. I'm feeling five years older. My body is really sore after that.
"So we left everything out there, and that's all I can ask for as a captain, that the guys fought. They showed that."
Earlier, Rassie van der Dussen gave South Africa something to bowl at as the Proteas -- who lost a thrilling semi-final to New Zealand four years ago -- struggled to 241-6 after losing the toss.
Hashim Amla made a sluggish 55 off 83 balls but Van der Dussen's 67 not out came at better than a run a ball.
During his innings, Amla became the fourth South African to reach 8,000 runs in one-day internationals.