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, all but ending the Proteas' World Cup semi-final hopes.
The Black Caps' skipper kept his cool at the end of a nerve-jangling match that went down to the last over with eight 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 due to a wet outfield.
Williamson 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.
New Zealand vs South Africa highlights
Earlier, Williamson rode his luck when South Africa failed to review his edge on 76 from that was taken by wicketkeeper Quinton de Kock off the bowling of Imran Tahir.
The win puts New Zealand top of the 10-team table in the round-robin phase of the competition in England and Wales while South Africa are third from bottom after just one win in six matches.
"It's nice to be there at the end," said man-of-the-match Williamson, who finished on 106 not out. "We knew at half time it was a tough surface.
"I thought the first half was a really good effort from us but we knew at the halfway stage it was far from done. We lost a few unfortunate wickets mixed in with some really nice bowling from South Africa."
Earlier, Martin Guptill, who had been guiding New Zealand towards their target with a minimum of fuss, trod on his stumps to spark a mini collapse.
The batsman, on 35, pulled Phehlukwayo and ended up swivelling, only to lose his balance and clip his leg stump with his foot.
Two overs later New Zealand slipped to 74-3 when Ross Taylor tickled a Chris Morris leg-side delivery and De Kock took the catch behind the stumps. Tom Latham's dismissal left them struggling at 80-4.
Jimmy Neesham (23) steadied the ship with his skipper but when he was out, New Zealand were back in 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 for 60 by South Africa captain Faf du Plessis off Lungi Ngidi in the penultimate over
Despite the late drama, Williamson kept his cool to see the beaten 2015 finalists home.
"I think Kane showed exactly what to do," said Du Plessis.
"He found it tricky to score but he waited for one guy, or a period, where he attacked. We had a lot of stop-start and that takes the extra 20 runs off the score."
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.