Potchefstroom: 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, Potchefstroom on Friday.
Smith made 116 -- his 10th one-day century -- 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 and 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.
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.
Smith made his 10th one-day century and there were 14 fours in his 130-ball innings.
Brief scores
New Zealand 260 for 9 (Munro 57, Elliott 54, Franklin 53*, Tsotsobe 4-45, McLaren 4-52)
South Africa 264 for 9 (Smith 116)
Result South Africa won by one wicket
MOM Graeme Smith (South Africa)