Brisbane - Australia overcame a week of turmoil to edge South Africa 23-18 in their Rugby Championship clash in Brisbane on Saturday.
The Wallabies capitalised on a poor second half by the Springboks, who led 18-17 at half-time but were let down by a host of handling errors after the break.
After two big losses to New Zealand to start the tournament, the Wallabies had to cope with the injury-enforced withdrawals of David Pocock and Israel Folau in the lead-up to the match.
They then lost towering lock Adam Coleman on the day of the match due to family reasons.
"We put a lot into our preparation this week and not all of that may have happened on the field, but... when someone tries to take (the win) away from you, you fight harder for it," Australian coach Michael Cheika said.
"That's what happened tonight - we fought harder."
Cheika said the Wallabies had coped well without Pocock and Folau.
"They took a step up in maturity as a team," he said.
The Wallabies appeared unfazed by the disruption when they scored in just the second minute of the match, captain Michael Hooper crashing over after 11 phases close to the South African line.
South African coach Rassie Erasmus had made a host of changes to the team that lost to Argentina a fortnight ago, with an eye on next Saturday's clash against the All Blacks.
They regrouped after conceding the early try and slowly gained the ascendancy.
Flyhalf Elton Jantjies kicked a penalty to make it 7-3 to the Wallabies, before hooker Bongi Mbonambi crashed over at the back of a devastating rolling maul to put the visitors ahead 10-7.
Right wing Makazole Mapimpi made it 15-7 with 10 minutes remaining in the half when he slid over in the corner following a beautiful flat pass from scrumhalf Faf de Klerk.
But four minutes later Mbonambi turned hero to villain when he missed his target from a long throw in at a defensive line-out.
Wallaby inside centre Matt Toomua pounced on the loose ball to score under the posts.
A second Jantjies penalty put the South Africans out to an 18-14 lead but right on half-time, Wallabies outside centre Reece Hodge converted a 53-metre penalty to make it a one-point game at the break.
The second half became an arm wrestle as both teams began to struggle with greasy conditions after a day of rain in Brisbane.
The Australians piled on the pressure for the opening 15 minutes of the second half as the South Africans' error rate began to climb.
The Springboks resisted bravely, but eventually conceded a penalty and Toomua put the home side back in front 20-18.
A second Toomua penalty gave the Wallabies some breathing space and they were able to hold on in the face of some huge late pressure from the South Africans.
Tries: Michael Hooper, Matt Toomua
Conversions: Matt Toomua (2)
Penalties: Reece Hodge, Matt Toomua (2)
Tries: Bongi Mbonambi, Makazole Mapimpi
Conversions: Elton Jantjies
Penalties: Elton Jantjies (2)
15 Dane Haylett-Petty, 14 Jack Maddocks, 13 Reece Hodge, 12 Matt Toomua, 11 Marika Koroibete, 10 Kurtley Beale, 9 Will Genia, 8 Pete Samu, 7 Michael Hooper (captain), 6 Lukhan Tui, 5 Izack Rodda , 4 Rory Arnold, 3 Allan Alaalatoa, 2 Tatafu Polota-Nau, 1 Scott Sio
Substitutes: 16 Folau Faingaa, 17 Tom Robertson, 18 Taniela Tupou, 19 Rob Simmons, 20 Ned Hanigan, 21 Joe Powell, 22 Bernard Foley, 23 Tom Banks
15 Willie le Roux, 14 Makazole Mapimpi, 13 Jesse Kriel, 12 Damian de Allende, 11 Aphiwe Dyantyi, 10 Elton Jantjies, 9 Faf de Klerk, 8 Warren Whiteley, 7 Pieter-Steph du Toit, 6 Siya Kolisi (captain), 5 Franco Mostert, 4 Eben Etzebeth, 3 Frans Malherbe, 2 Bongi Mbonambi, 1 Steven Kitshoff.
Substitutes: 16 Malcolm Marx, 17 Beast Mtawarira, 18 Wilco Louw, 19 RG Snyman, 20 Francois Louw, 21 Embrose Papier, 22 Handre Pollard, 23 Cheslin Kolbe