Left-arm fast bowler Marco Jansen dismissed the first five Australian batsmen to clinch a come-from-behind series win for South Africa in the fifth one-day international at the Wanderers Stadium on Sunday.
Jansen took five for 39 as Australia were bowled out for 193 in reply to South Africa's 315 for nine.
South African captain Temba Bavuma said the character of the team had shone through after they lost the first two matches of the series, which boded well for the World Cup in India next month.
"There is a lot of confidence we can take, in that we had our backs against the wall and we showed we have ways of getting on top of the game. We will go to India in probably the best state we can be."
South Africa won each of the last three matches by more than 100 runs after they were sent in to bat by Australian captain Mitchell Marsh.
Marsh admitted: "We were outplayed in the last three games but we have a one-day game in India on Friday, a lot of players coming back and a big World Cup coming up."
Several leading players, including regular captain Pat Cummins, fellow fast bowler Mitchell Starc, all-rounder Glenn Maxwell and star batsman Steve Smith, will join the team for a pre-World Cup series against India starting in Mohali on Friday.
Marsh's decision to bowl first in the only day game of the series seemed justified on Sunday when his bowlers reduced South Africa to 103 for four in the 24th over on a pitch which offered sideways movement and bounce to the seamers.
Player of the series Aiden Markram (93) and David Miller (63) put on 109 for the fifth wicket and lower order batsmen Jansen and Andile Phehlukwayo took the total past 300 with some big hitting towards the end.
Jansen hit three sixes in scoring 47 off 29 balls and Phehlukwayo cleared the boundary four times in his unbeaten 39 off 19 deliveries.
Marsh and David Warner blasted 34 off the first three overs of the Australian innings but Jansen came into the attack and dismissed Warner and Inglis in a double-wicket maiden over.
Marsh (71) and Marnus Labuschagne (44) put on 90 for the third wicket but Jansen dismissed both set batsmen and Alex Carey in a burst of three wickets off seven balls to put South Africa in command.