An after-the-hooter penalty from Quade Cooper saw the Wallabies claim a 28-26 win over the world champion Springboks on the Gold Coast on Sunday.
Cooper, returning to the Australian No 10 jersey for the first time in more than four years, was flawless on the day as he kicked seven penalties and a conversion.
AS IT HAPPENED | Wallabies 28-26 Springboks
The Springboks, meanwhile, were nowhere near their best, short on execution for large parts of this Rugby Championship clash.
They scored three tries to one from their hosts - all through the rolling maul - and looked to have rescued the match until Cooper's last-gasp winner.
It is often said in elite sport that a sign of a championship winning side is an ability to win even when playing poorly, and that was not the case here.
Error-ridden, ill-disciplined and nowhere near the clinical standards that made them 2019 World Cup winners and, more recently, British & Irish Lions series winners, the Boks were poor, and they were punished.
There were yellow cards for Siya Kolisi and Willie le Roux.
The result leaves South Africa second on the Rugby Championship log with 10 points - five behind leaders New Zealand (15) at the half-way stage.
After both sides engaged in an unsurprising kicking exchange in the early stages, Handre Pollard and the returning Cooper exchanged two penalties each for the scores to be locked at 6-6 after 13 minutes.
The Boks, through Faf de Klerk, Pollard and Le Roux, kicked heavily, but some smart body positioning from the Wallabies meant that the visitors were struggling to get contenders into the air to challenge for box kicks.
The momentum changer in the first half, though, came on 16 minutes when Bok skipper Kolisi was yellow-carded for a dangerous tip-tackle on Wallabies fullback Tom Banks.
There was no controversy surrounding the decision and, if anything, Kolisi was lucky to escape red, but from the resulting lineout and against 14 men, Australia launched an attack that saw a superb pass from Samu Kerevi release Andrew Kelleway down the right.
The No 14 wing cut inside and scored his side's opening try, with Cooper adding the extras to give the Wallabies a 13-6 lead.
The Boks weathered the storm until Kolisi came back on, and their best phase of play came when they were camped on the Australian line with rolling maul after rolling maul being illegally defended.
There was an embarrassing moment for centre Lukhanyo Am, who dropped the ball over the try line after gathering a De Klerk attacking stab when a try looked a certainty.
Fortunately for Am, the Boks scored soon after that when Aussie lock Matt Philip was yellow-carded. From the resulting maul, the Boks barged over where Bongi Mbonambi dotted down.
Pollard, though, missed the conversion - his second miss of the night - and the Boks were still 13-11 down.
Cooper then stretched the lead to 16-11 after the Boks were caught off-sides before, on the stroke of half-time, the Wallabies scrum bulldozed the Boks on their own 5m line in a moment that sent a massive statement.
Copper chipped over the kick, the Wallabies were 19-11 up at the break and the world champions were left with it all to do in 40 minutes.
The Springboks needed to start the second half brightly, and they won a scrum penalty on 42 minutes only for Pollard to crack a routine penalty attempt straight into the upright.
He made amends soon after, though, when he knocked over his third penalty of the night after the Boks had won a penalty on the ground following another dominant maul.
The Boks could not get anything going for sustained periods, though, and when Le Roux was yellow carded on 52 minutes for a deliberate knock-down with the Wallabies on attack, the Boks were down to 14 men for the second time in the contest.
Cooper kicked his fifth penalty, and the Wallabies had their eight-point lead restored at 22-14 and the Boks were on the ropes.
When Wallabies hooker Folau Faingaa was sin-binned for a no-arms hit on Ox Nche, though, the Boks had their window to get back into the match.
It was the rolling maul, again, that paid dividends as Malcolm Marx scored South Africa's second and when Pollard curled his conversion from the left touchline through the uprights, the Boks were just 22-21 down with 20 to play.
Jasper Wiese then gave away a senseless penalty that was punished by Cooper from 40m out - the Wallabies playmaker landing his seventh successful kick of the night.
The one thing that was working for the Boks, though, was the rolling maul and after another sustained period of lineout attack, the visitors landed their third try of the night to go ahead 26-25 as Damian Willemse missed the conversion.
With just seconds remaining, the Wallabies were awarded a scrum penalty 40m out.
Cooper, who was flawless on the night, stepped up when it mattered most, slotting the kick and the men from 'Down Under' celebrated like they had won their own World Cup.
The Springboks missed 10 points on the night through misses kicks, with Pollard missing three attempts and Willemse one.
SA 26 (11)
Tries: Bongi Mbonambi, Malcolm Marx (2)
Penalties: Handre Pollard (3)
Conversion: Handre Pollard
Australia 28 (19)
Try: Andrew Kellaway
Conversion: Quade Cooper
Penalties: Cooper (7)
15 Willie le Roux, 14 Sbu Nkosi, 13 Lukhanyo Am, 12 Damian de Allende, 11 Makazole Mapimpi, 10 Handre Pollard, 9 Faf de Klerk, 8 Duane Vermeulen, 7 Franco Mostert, 6 Siya Kolisi (captain), 5 Lood de Jager, 4 Eben Etzebeth, 3 Frans Malherbe, 2 Bongi Mbonambi, 1 Steven Kitshoff
Substitutes: 16 Malcolm Marx, 17 Ox Nche, 18 Vincent Koch, 19 Marco van Staden, 20 Kwagga Smith, 21 Jasper Wiese, 22 Herschel Jantjies, 23 Damian Willemse
15 Tom Banks, 14 Andrew Kellaway, 13 Len Ikitau, 12 Samu Kerevi, 11 Marika Koroibete, 10 Quade Cooper, 9 Tate McDermott, 8 Rob Valetini, 7 Michael Hooper (captain), 6 Lachlan Swinton, 5 Matt Philip, 4 Izack Rodda, 3 Allan Alaalatoa, 2 Folau Fainga'a, 1 Angus Bell
Substitutes: 16 Feleti Kaitu'u, 17 James Slipper, 18 Taniela Tupou, 19 Rob Leota, 20 Pete Samu, 21 Nic White, 22 Reece Hodge, 23 Jordan Petaia