Former captain Graeme Smith hit a century to set up a consolation one-wicket win for South Africa in the third and final one-day international against New Zealand at Senwes Park on Friday.
Smith made 116 in 130 balls - his 10th one-day century laced with 14 fours - but it needed a six off the last ball by all-rounder Ryan McLaren to enable South Africa to chase down a New Zealand total of 260 for nine.
Smith was sixth man out when 32 were still needed off 26 balls.
"I would like to have seen it through," said Smith, who was caught at wide long-on off the off-spinner Kane Williamson. "The shot was on but the execution wasn't right."
Three more wickets fell as New Zealand applied the pressure.
Dale Steyn was caught in the deep off James Franklin off the fifth ball of the final over but it brought McLaren back on strike.
Franklin bowled short and McLaren swung hard to send the ball sailing into the crowd beyond backward square leg.
The result spared South Africa the embarrassment of being whitewashed by their opponents, who started the series ranked ninth in one-day internationals, while the hosts were briefly ranked number one.
"It was nerve-wracking," admitted South African captain Faf du Plessis. "It was very important for us as a team but there is a lot to work on."
New Zealand captain Brendon McCullum said the 2-0 series win had been a big boost for his players.
"They have shown their fighting characteristics, especially after the Test series, which was a very tough few weeks for us," he said.
As was the case in the first two matches, New Zealand's batsmen prospered in the closing overs of their innings, while the South Africans started well but struggled to accelerate.
Lonwabo Tsotsobe and McLaren took four wickets each but could not prevent a flurry of runs from New Zealand in the closing overs.
Grant Elliott, Colin Munro and Franklin hit half-centuries for New Zealand, who were struggling at 96 for four after 30 overs but added 164 runs in the last 20 overs.
Tsotsobe took four for 45 and McLaren claimed four for 52 but as in the first two matches the South African bowlers were unable to exert control towards the end of an innings.
Tsotsobe bowled an excellent opening spell of two for nine in five overs as New Zealand lost their first three wickets for 46 runs.
When Brendon McCullum fell for 13 with the total on 68 New Zealand were in trouble.
But Elliott (54) and Munro (57) added 67 for the fifth wicket, while Franklin again batted well with the tail to make an unbeaten 53.
South Africa were 44 runs ahead at the 30-over mark but came close to repeating the collapse which led to a 27-run defeat in the second match in Kimberley.