Centuries from Faf du Plessis and David Miller overshadowed Shaun Marsh's as South Africa successfully defended 320 in the final one-day international against Australia in Hobart to win the series 2-1.
A top-order collapse followed by a middle-order resurgence from both teams marked the series finale in Hobart where Australia and South Africa went tooth and nail to clinch the series, but the visitors came out victorious by 40 runs, restricting Australia to 280/9 in reply to their 320/5.
After Aaron Finch won the toss and put South Africa in, Mitchell Starc and Marcus Stoinis rattled the visitors early on with three quick wickets. Quinton de Kock (4) and Reeza Hendricks (8) were dismissed in the first 10 overs, to Starc and Stoinis, respectively.
Aiden Markram (32) resisted for a while longer, but was soon sent back by Starc with the score 55 in the 16th over.
Thereafter began the counter-attack from captain Faf du Plessis (125) and David Miller (139), who added 252 runs for the fourth wicket and helped South Africa post a solid total.
In reply, Australia too stuttered at the start, losing Chris Lynn for a first-ball duck to Dale Steyn and captain Finch (11) to Lungi Ngidi. When Kagiso Rabada had Travis Head (6) caught by Markram at point, Australia were in big trouble at 39/3.
But Marsh and Stoinis followed in du Plessis and Miller's footsteps, took their time to rebuild the innings, and then took the attack to the South Africans, Imran Tahir and Dwaine Pretorius in particular, who were carved for sixes over the mid-wicket region.
Together, Marsh and Stoinis added 107 runs for the fourth wicket to give Australia a good chance at winning the series. Stoinis was the more aggressive of the two for the time he was at the crease, hitting four sixes and five fours in his 76-ball 63 before Pretorius broke the partnership in the 30th over by getting the right-hander caught at point.
With 175 runs needed off the final 20 overs, new batsman Alex Carey gave the much-needed cushion to the set Marsh, who had also brought up his fifty by then, to go for the attack by continuing to rotate the strike.
Marsh hit Ngidi for a flat-batted six over wide long-on and then brought up his century with a couple off Tahir in the 41st over.
With 106 runs needed off the last 10, the batsmen were to go on the offensive sooner rather than later, and when Marsh hit Tahir inside-out in the same over for four, it looked like the senior pro was going to be the one to take risks.
However, Pretorius swung the game back in South Africa's favour by dismissing Marsh in the next over, when the left-hander looked to whip one towards the leg side but ended up skying it to Heinrich Klaasen at wide long-on.
With 87 runs needed off the last eight overs, the onus was on Glenn Maxwell to take Australia past the line and he began well by hitting Pretorius for four towards square leg to open his account.
Du Plessis, who had saved his front-line bowlers – Rabada, Ngidi and Steyn – for the death, unleashed them from the 44th over onwards, but Maxwell, undeterred, smashed Rabada for a boundary through mid-wicket to bring it down to 71 off 36.
But Steyn dismissed Carey for 41 in the next over to make it even tougher for Australia as 65 off 30, even with Maxwell at the crease, looked daunting. And it proved to be just that, courtesy some excellent death bowling by South Africa as only 25 runs came off the last five overs with Maxwell being dismissed in the penultimate over by Steyn for 35 off 27.
Steyn was the pick of the bowlers for South Africa, returning 3/45 from 10 overs, while Pretorius got 2/61. Rabada and Ngidi got a wicket each.
Earlier, South Africa were revived by centuries from du Plessis and Miller, who took them from a precarious position to well over 300.
Miller was the more aggressive of the two, smashing 13 fours and four sixes in his 108-ball knock while du Plessis went at his own pace, hitting 15 fours and four sixes during his 114-ball stay.
And although both of them departed in the final two overs, they had done enough damage to take South Africa to what proved to be a winning total.
Personalise your homepage with an ICC account
News, fixtures and updates tailored to your favourite team. Never miss a moment!