David Miller's unbeaten 118 ensured South Africa smashed the highest second-innings score at Kingsmead to defeat Australia.
The unbeaten David Miller was the star as South Africa completed their second-highest run chase in one-day international history to claim a phenomenal four-wicket victory and series win in an enthralling clash with Australia in Durban.
Faf du Plessis' Proteas triumphed in the first two matches of the five-game series but looked set to be pegged back as centuries from David Warner and Steve Smith inspired the tourists to what ended up being only being temporarily the highest ODI total at Kingsmead of 371.
Warner scored 117 off 107 deliveries, becoming the second-fastest Australian to reach 3,000 runs in the 50-over format in the process, while Smith earned a first ODI hundred since January as Australia set an imposing total.
No team had amounted more than 271 runs in the second innings of a one-day match on this ground prior to Wednesday, but South Africa, spearheaded by Miller's unbeaten century, smashed that mark.
The returning Hashim Amla (45) – in as one of two changes that also included Dwaine Pretorius replacing the injured Wayne Parnell – and Quinton de Kock (70) got South Africa's response off to a strong start.
Miller then propelled the hosts forward with a brilliant 69-ball hundred and he developed an unbreakable partnership with Andile Phehlukwayo (42 not out) that saw the duo plunder 107 runs off 70 deliveries in the closing stages, completing a phenomenal turnaround in the final over.
Warner set the tone for Australia's innings by claiming a four off Dale Steyn's (2-96) third ball, and he made things worse for the paceman in the third over by plundering 17 runs which included the first maximum.
Aaron Finch (53) followed suit with a pair of sixes off Steyn as part of an electric 32-ball fifty, but he lofted Imran Tahir (2-54) to Kagiso Rabada (1-86) at mid-off to bring his 110-run partnership with Warner to an end.
The run-rate quickly dropped and De Kock missed a chance to stump Warner on 93, the Australian going on to reach three figures before holing out to long-off.
Despite the losses of George Bailey (28) and Mitchell Marsh (2), Smith took on the mantel and reached his sixth ODI hundred with a trio of fours off Phehlukwayo (1-58) before being bowled by Steyn, but it proved not to be enough against an inspired South Africa.
The tourists struggled to contain Amla as he reached the boundary with ease, though he was trapped lbw short of his fifty by John Hastings (2-79).
De Kock brought up his fifty with a shot to the fine-leg boundary, but Chris Tremain (1-65) stopped him inflicting further damage before Rilee Rossouw (18) fell to Adam Zampa (1-55).
Miller took just five runs off the first 15 deliveries faced but he soon stepped up a level, sending Zampa to the ropes three times in the same over.
Thirty balls later Miller brought up his fifty, and the runs continued as he accelerated to his century with a show of dominance and power.
The Proteas required 58 runs off the final six overs and they got their with four balls remaining, Phehlukwayo lifting Zampa to third man for two runs that sparked delirium on the pitch and in the stands.
Australia will now look to pick themselves up and focus on avoiding a whitewash when the teams meet again in Port Elizabeth on Sunday.