Graeme Smith's century almost proved in vain, but Ryan McLaren struck a six off the last ball of the match to afford South Africa a tense one-wicket win over New Zealand in Friday's third and final ODI in Potchefstroom.

Graeme Smith's century almost proved in vain, but Ryan McLaren struck a six off the last ball of the match to afford South Africa a tense one-wicket win over New Zealand in Friday's third and final ODI in Potchefstroom.

Stunned in matches one and two, the Proteas avoided a three-nil series whitewash by the tightest of margins, with Smith and McLaren ultimately the heroes in front of a near sellout Senwes Park crowd.

The Black Caps' total of 260 for nine was built on the back of half-centuries from Grant Elliott, Colin Munro and James Franklin, though captain Brendon McCullum will be the first to admit the score was substandard for a bountiful pitch. Lonwabo Tsotsobe and McLaren, meanwhile, appreciated their respective hauls of four for 45 and four for 52.

All signs pointed to a one-sided chase, too, with the Proteas cruising to 165 for two inside 34 overs before a collapse similar to that experienced in Kimberley ensued.

Losing their next seven wickets for a mere 93 runs, smiles were far and few between in the home camp. Smith's outstanding ton, however, was the loan highlight amid an otherwise awkward pursuit.

In a month that has seen the country's leadership cast into crisis, with AB de Villiers banned and Faf du Plessis an unsuccessful successor, the veteran Smith showed all and sundry why he led the limited-overs fold for so many years - and why he should perhaps still be doing so.

The 10th century of his prolific career was lined with 14 fours, with 130 deliveries required for his 116 runs - before one hefty strike too many saw him hole out on the long-on fence.

South Africa's middle order flopped and the would-be all-rounders flattered to deceive, but the blossoming McLaren eventually defied the odds. With all of three runs required off the final ball of a humdinger fixture, a cheeky piece of premeditation from the left-hander lofted James Franklin's final delivery high and hard over the backward square-leg fence for six.