A six from Ryan McLaren off the final delivery and a rapid 116 by Graeme Smith helped South Africa to a thrilling one-wicket victory over New Zealand in the third one-day international this morning.
The Proteas, who came into the game having already lost the three-match series 2-0, had been set a target of 261 after half-centuries from Grant Elliott (54), Colin Munro (57) and James Franklin (53 not out) had steered New Zealand to 260 for nine in their 50 overs.
Man-of-the-match Smith's knock seemed to have put the home side on course for victory but a lower-order collapse meant they required three off the final delivery with just one wicket in hand.
However, a six over fine leg from all-rounder McLaren (25 not out) gave South Africa their first victory of the series and ensured they avoided a whitewash.
New Zealand had already claimed their first ODI series on South African soil but still went wholeheartedly for the final victory as they won the toss and elected to bat.
They made a slow start as a fine opening spell from left-arm seamer Lonwabo Tsotsobe (10-2-45-4) helped restrict them to 68 for four in the 22nd over.
The half-centuries from Elliott and Munro saw the Black Caps put on successive fifty partnerships and by the time both men had been dismissed, the visitors had recovered to 196 for six after 43 overs.
Despite a late flurry of wickets, Franklin came in and played with freedom. His undefeated innings was rounded off in style as he reached his fourth ODI fifty with a six in the final over from Rory Kleinveldt.
The South African reply made a brisk start as the left-handed opening duo of Smith and Quinton de Kock (31) took the score to 54 without loss after the first powerplay.
Franklin (6-0-38-2) made the breakthrough in the 16th over when he bowled de Kock but at 83 for one, the openers had laid a good platform for the home side.
Smith looked undeterred by the loss of his partner and later reached the fifty-mark in the 20th over.
He and Colin Ingram (25) then took the score to 122 by the end of the 26th over and it prompted the pair to take the batting powerplay.
The decision merely succeeded in yielding instant dividends for New Zealand though as Nathan McCullum (10-1-35-1) had Ingram caught at mid-wicket with the next delivery.
South Africa then showed signs of stuttering as the dismissals of captain Faf du Plessis (19) and Farhaan Behardien (4) reduced them to 174 for four.
Smith was not to be denied though and brought up his 10th ODI century with consecutive boundaries off Kane Williamson (8-0-40-2) in the 41st over.
But the dismissal of David Miller (15) in the following over triggered a collapse including the wicket of Smith, meaning South Africa needed eight off the final over with just two wickets in hand.
The Proteas required three off the final two deliveries and when Dale Steyn (4) was caught on the boundary, it was left to McLaren to get the hosts over the line.
The left-hander duly obliged as he dispatched the final delivery from Franklin (6-0-38-2) over fine leg for a dramatic six to the delight of the ecstatic crowd.
Scoreboard for the third one-day international between South Africa and New Zealand:
M GUPTILL c Ingram b Tsotsobe 5
B WATLING c Plessis b McLaren 20
K WILLIAMSON c Kock b Tsotsobe 6
G ELLIOTT c Steyn b Tsotsobe 54
B McCULLUM c Steyn b McLaren 13
C MUNRO c Kock b Tsotsobe 57
J FRANKLIN not out 53
N McCULLUM c Kock b McLaren 2
J NEESHAM lbw McLaren 13
K MILLS run out 7
M McCLENAGHAN not out 2
Extras (1b 10lb 17w) 28
Total (for nine Wickets) 260
Fall: 15 (Guptill), 27 (Williamson), 46 (Watling), 68 (B McCullum), 129 (Elliott), 196 (Munro), 199 (N McCullum), 216 (Neesham), 234 (Mills).
Bowling: D Steyn 10-1-56-0 (6w), L Tsotsobe 10-2-45-4, R Kleinveldt 10-1-44-0 (4w), A Phangiso 8-0-43-0 (1w), R McLaren 10-0-52-4 (2w), F Behardien 2-0-9-0.
Q de KOCK b Franklin 31
G SMITH c Watling b Williamson 116
C INGRAM c Guptill b N McCullum 25
F DU PLESSIS c Guptill b Mills 19
F BEHARDIEN c&b Williamson 4
D MILLER b Mills 15
R McLAREN not out 25
R KLEINVELDT b McClenaghan 6
A PHANGISO c B McCullum b McClenaghan 9
D STEYN c Elliott b Franklin 4
L TSOTSOBE not out 0
Extras (4b 1lb 5w) 10
Total (for nine Wickets) 264
Fall: 83 (Kock), 122 (Ingram), 165 (Plessis), 174 (Behardien), 205 (Miller), 229 (Smith), 237 (Kleinveldt), 251 (Phangiso), 258 (Steyn).
Bowling: K Mills 10-0-40-2, M McClenaghan 10-0-70-2 (3w), J Neesham 3-0-22-0 (2w), N McCullum 10-1-35-1, J Franklin 6-0-38-2, G Elliott 3-0-14-0, K Williamson 8-0-40-2.
Result: South Africa won by 1 wicket
New Zealand beat South Africa 2-1 to win three-match series
Will the Black Caps win the second test at Headlingley?