Ireland could not extend their run of three successive victories over South Africa as the Boks spoiled the opening party at the new Aviva Stadium.
The World Champions controlled the game during the early exchanges and then managed to cling on as Ireland staged a dramatic fight-back.
Tries from Tommy Bowe and Rob Kearney clawed Ireland back into contention, but Ronan O'Gara failed with a difficult conversion to level the scores late on.
Fly-half Morne Steyn opened the scoring with a penalty before converting an early Juan Smith try. Flanker Smith intercepted a lose Eoin Reddan pass and raced clear to score in the corner.
Steyn and Jonny Sexton exchanged penalties before Zane Kirchner and Gio Aplon linked up on the touchline and full back Aplon raced clear to extend the visitors advantage.
Bowe collected replacement O'Gara's chip through to score and O'Gara celebrated his 100th appearance by slotting the conversion.
Jamie Heaslip started a sweeping move which Kearney rounded off by touching down, but O'Gara failed his conversion attempt and South Africa hung on for the win.
Wales 16-25 Australia
Wales had complete control up-front and embarrassed the visitors at the scrum but it was Australia's clinical back-line that was the difference in Cardiff.
Quade Cooper and Man-of-the-match Kurtley Beale orchestrated the young three-quarters as Australia carried on from where they left off in Hong Kong last weekend.
David Pocock scored an early try which was converted by Cooper before Stephen Jones fought back for Wales with two first half penalties.
The visitors could not live with the power of the Welsh pack and conceded seven penalties at the scrum and Wales used their forwards well to create point scoring chances.
Wales were without a host of stars including Lee Byrne, Leigh Halfpenny, Jamie Roberts and Ryan Jones but have a lot to take from the game ahead of South Africa's visit to the Millennium Stadium next Saturday.
Beale scored one of Australia's two second half tries, with prop Ben Alexander collecting the other 5-pointer.
Replacement Richard Rees scored with 10 minutes remaining to give the hosts a glimpse of victory but it was not to be, James O'Connor kicking a late penalty to seal the win.