Quade Cooper kicked a penalty for Australia after the hooter to secure a dramatic win against world champions South Africa in the Rugby Championship.
Cooper, who played the last of his 70 Tests in 2017 against Italy, returned to the international fold last month.
The 33-year-old fly-half was his side’s hero, finishing with 23 points.
Earlier, Luke Jacobson crossed twice as New Zealand thrashed Argentina to earn their third bonus-point win in as many matches to stay top of the table.
Cooper held his nerve to strike the ball sweetly from 40 metres out on an angle after scrum-half Nic White poached the ball from the last scrum in a thrilling finish.
“Quade is a big-time player and he stepped up and said ‘I’ve got it’ and he nailed it,” said Michael Hooper, who equalled George Gregan’s record for most Tests as Wallabies captain after leading his side for a 59th time.
Andrew Kellaway scored the Wallabies’ only try on 17 minutes but Cooper’s boot kept them in contention.
The Springboks scored all three of their tries from line-out drives, with Malcolm Marx grabbing two and the other coming from Bongi Mbonambi.
It was a much-needed win for the Wallabies’ former Glasgow coach Dave Rennie after the team lost to the All Blacks three times in the space of a month.
The All Blacks dominated for long periods against the Pumas but only led 7-0 after 30 minutes thanks to Rieko Ioane’s opener as a result of some determined Argentina defence.
But they scored twice in the closing stages of the first half through Sevu Reece and Dalton Papalii to lead 22-0 at the break after Pablo Matera, one of Argentina’s most effective tacklers, was sent to the sin bin by referee Nic Berry following warnings about repeated infringements.
Jacobson scored the second of his two tries after replacement prop Carlos Muzzio was yellow carded as Argentina again suffered disciplinary problems.
South Africa: Le Roux, Nkosi, Am, de Allende, Mapimpi, Pollard, De Klerk, Kitshoff, Mbonambi, Malherbe, Etzebeth, De Jager, Kolisi, Mostert, Vermeulen.
Replacements: Marx, Nche, Koch, Van Staden, Smith, Wiese, H. Jantjies, Willemse.
Australia: Banks, Kellaway, Ikitau, Kerevi, Koroibete, Cooper, McDermott, Bell, Fainga’a, Alaalatoa, Rodda, Philip, Swinton, Hooper, Valetini.
Replacements: Kaitu’u, Slipper, Tupou, Leota, Samu, White, Hodge, Petaia.
Referee: Luke Pearce (RFU)
New Zealand: J. Barrett, Reece, R. Ioane, Havili, Bridge, B. Barrett, Perenara, Tuinukuafe, Aumua, Laulala, Retallick, S. Barrett, A. Ioane, Papali’i, Jacobson.
Replacements: Taukeiaho, Moody, Lomax, Vaa’i, Blackadder, Weber, McKenzie, Tupaea.
Argentina: Mallia, Delguy, Moroni, de la Fuente, Carreras, Sanchez, Bertranou, Gigena, Montoya, Medrano, Petti, Alemanno, Matera, Kremer, Bruni.
Replacements: Bosch, Muzzio, Pieretto, Lavanini, Gonzalez,Garcia, Chocobares, Boffelli.