The Wallabies have come from behind to edge the Springboks 24-23 in their Rugby Championship clash in Perth.
Australian first five Bernard Foley converted winger Rob Horne's 78th minute try 10 metres out from the sideline in treacherous, wet Perth conditions to steal a dramatic 24-23 victory.
The South Africans had lost veteran wing Bryan Habana, playing his 100th Test, in the 65th minute to a yellow card that let the home side back into the match.
Fullback Israel Folau crossed for his 15th Test try after two minutes but for much of the rest of the evening Australia were chasing the game, and it was only when Horne went over in their best move of the match that victory looked likely.
Foley, who also kicked four penalties, stepped up to nervelessly slot the conversion and give coach Ewen McKenzie his first win over one of the southern hemisphere superpowers since he took over last year.
The Springboks scored a try to winger Cornal Hendricks and six penalties from the boot of No.10 Morne Steyn, and led 14-11 at half-time.