What looked like being a stroll to a convincing 4-1 series triumph when Steve Smith departed for 67 with Australia 11 runs from their target of 275 was transformed into a tense finale by Robin Peterson.
The South African spinner (4-32) did most of the damage as the hosts lost four wickets for three runs but James Faulkner held his nerve to smash the winning runs off the first ball of the final over.
For much of the evening, though, the South Africans looked like they were mentally on the plane home and looked unlikely to defend their original tally of 280 for six, let alone the amended target put in place after a short storm.
Australia’s masterblaster openers set about the chase in typical flamboyant fashion but David Warner (21) had already departed when the rain delay reduced their allocation of overs to 48.
There was no stalling Aaron Finch, however, and he put on 100 with Shane Watson before falling for 76 to a brilliant piece of fielding from Faf du Plessis, who caught the ball falling over the rope but offloaded it to Rilee Roussouw.
South Africa’s bowling appeared to lack bite without the rested Dale Steyn and Watson cashed in with 82 off 93 balls, clubbing a second huge six a couple of balls before holing out to Roussouw at deep midwicket.
Smith’s innings lacked the fluency of his 104 in Melbourne or his unbeaten 73 in Canberra and he admitted he had caught a couple of breaks, most notably when he was bowled by Kyle Abbot off a front foot no ball.
Earlier in the afternoon sun, Quinton de Kock’s fine 123-ball 107 anchored the South African innings before the opener became Pat Cummins (3-54) third victim when he nicked the ball attempting an uppercut and was caught behind.
Roussouw (51) and Du Plessis (2) had earlier fallen victim to the young Australian quick in one rain-disrupted over.
De Kock’s exit left the tourists on 206 for five with just under 10 overs remaining but Farhaan Behardien did his World Cup chances no harm with a blistering career-best 63 from 41 balls to bolster South Africa’s tally.
(Editing by Ed Osmond)