Ryan McLaren hit a six off the last ball of the match to earn South Africa a one-wicket victory in the third and final One Day International against New Zealand at Potchefstroom.
New Zealand had already won the first two ODIs to claim the series.
Chasing the Black Caps' total of 260-9, South Africa looked to be cruising before Graeme Smith holed out for 116 with 32 needed from 27 balls.
Three more wickets fell quickly but McLaren kept his nerve with three needed from the final ball, scooping James Franklin's delivery over third man for a maximum.
Earlier McLaren had taken 4-52, while Lonwabo Tsotsobe finished with 4-45 as the Kiwis reached 260-9, half centuries from Grant Elliott, Colin Munro and Franklin proving the bedrock of their innings.
Franklin hit an unbeaten 53 from 52 balls to take the total into the competitive range, with 26 coming from the last two overs.
South Africa were always up with the run-rate and with Smith looking rock-solid, they seemed set to cruise home.
He brought up his 11th ODI century and with the Proteas having won eight of the 10 games in which their talisman had previously made three figures, the result looked in little doubt.
But with just 32 needed Smith inexplicably tried to blast Kane Williamson over the top and a top edge found Bradley-John Watling at deep mid off.
That set up a nervy last four overs and it went right to the wire, before McLaren's improvised blow off the final ball at least helped salvage some pride and avoid a series whitewash for the hosts.