Andre Nel hit nine runs off the last three balls of the match on Sunday to take South Africa to a two-wicket victory in the first of three one-day internationals against New Zealand.
South Africa needed 11 runs off the last over with Mark Boucher the last recognized batsman still at the crease in pursuit of New Zealand's 248-6 at Kingsmead Stadium.
Nel missed the first ball of Mark Gillespie's over and hit the second for a single to get Boucher on strike.
Boucher scrambled a single off the third ball before Nel drilled the fourth ball past cover for four and lifted the next one over extra cover for another boundary.
The final delivery was sliced just over the ring of fielders brought in to save the single and the Proteas had scraped a victory that had seemed destined to go to the Black Caps.
New Zealand captain Daniel Vettori said he was disappointed by the final over, as well as three dropped catches.
"Mark Gillespie is probably one of our best death bowlers, and if we had taken a catch or two it might have made all the difference," Vettori told a news conference. "We should have won the game."
South Africa's chase started badly with Morne van Wyk -- in for the injured Herschelle Gibbs -- being bowled for a duck off the third ball of the innings by Mills.
Mills returned the best bowling figures of his one-day international career, taking 5-25. He took 3-7 in his final two overs as South Africa seemed to slip in sight of the finish.
After Mills dismissed Jacques Kallis for 1, South Africa captain Graeme Smith and A.B. de Villiers set about rebuilding the innings. Smith fell for 44 trying to pull Scott Styris over square leg, but De Villiers pushed on and eventually was well held by Vettori off his own bowling for 87.
J.P. Duminy hit a bright 46 off 59 balls before also holing out to a mistimed pull shot, leaving Boucher to steer South Africa to victory. The wicketkeeper finished on 35-not-out. Nel was 10-not-out.
Earlier, Jamie How scored 90 to help New Zealand reach 248-6. He hit 11 fours in 124 balls before edging a delivery from Nel onto his stumps in the 48th over.
Nel was the best of South Africa's bowlers. He clean bowled Gareth Hopkins with the next delivery after dismissing How and also had Styris (40) caught by Johan Botha at midwicket after top-edging a pull shot to finish 3-46.
Opener Brendon McCullum survived a lot of movement through the air in overcast conditions and off the pitch to score a battling 40 off 67 balls after Lou Vincent was bowled by Makhaya Ntini for 6.
Mathew Sinclair, who was hit on the helmet by a bouncer from Ntini, hit an undefeated 32 off 23 balls late in the innings to give New Zealand a defendable total.
Shaun Pollock conceded just 21 runs in his 10 overs, but the other bowlers were expensive. Albie Morkel conceded 54 runs for a single wicket, while Ntini went for 62 off nine overs.
South Africa won the Test series against New Zealand 2-0 and the Twenty20 international by three wickets on Friday. The next match in the series will be played on Friday in Port Elizabeth.