Wales paid a high price for failing to make their extra numbers count when the Wallabies were reduced to 13 men for seven minutes in the second half.
Fly-half Bernard Foley kicked all Australia's points, with Dan Bigger twice on target for Wales.
Australia now face Scotland in the quarter-final on 18 October, with Wales against South Africa the day before.
It was Wales' 11th consecutive defeat against the Australians, a run going back to 2008.
Wales coach Warren Gatland's men had their chances but were repelled by some extraordinary defence, with number eight Taulupe Faletau dropping the ball inches from the line and George North at centre held up over the line by Wallabies back-row Ben McCalman.
In the long run of narrow losses to Australia, this will rank among the most frustrating for Gatland.
There was a lack of composure in a 10-minute period around the hour mark, when Australia's battling 13 held firm.
And having seen off the barrage, the Wallabies eventually lifted the siege and were rewarded when Foley's fifth penalty gave his side a two-score cushion with eight minutes remaining.
Australia stated their intentions in the opening seconds when they opted to take a scrummage from the first penalty of the game deep in their own half.
They almost paid a high price when Gareth Davies sprinted away down the narrow side.
But Biggar's fourth-minute penalty was all Wales had to show for their early pressure.
Two unyielding defences battered anything that moved, with the breakdown a genuine contest and Wales successfully countering the Wallabies' driving maul.
However, as the half wore on and Australia's pack - and scrummage in particular - got on top, the penalty count mounted against the Welsh with Foley profiting.
The match was a slow burner but it burst into life at the start of the second half.
Australia drove the lineouts with more venom, but Wales took control after the Wallabies incurred the wrath of referee Craig Joubert.
Scrum-half Will Genia had a yellow card for failing to retire 10 metres as his opposite number Gareth Davies took a quick penalty and Genia was followed into the bin when second-row Dean Mumm infringed at a lineout.
However, Australia's defence while reduced to 13 was simply heroic.
Australia's seemingly easier path to a possible final - avoiding South Africa and New Zealand en route - is reward for a courageous and skilful rearguard action.
They will look forward to their battle with the Scots, while Wales face a resurgent Springbok side.
The nature of yet another defeat to Australia, however, will leave a bitter taste in the mouth.
Gareth Davies of Wales was a livewire for the whole of the game and won this accolade. But this was a match won by the defence of Australia.
Wales: Gareth Anscombe; Alex Cuthbert, George North, Jamie Roberts, Liam Williams; Dan Biggar, Gareth Davies; Paul James, Scott Baldwin, Samson Lee, Luke Charteris, Alun Wyn Jones, Sam Warburton, Justin Tipuric, Taulupe Faletau.
Replacements: Ken Owens for Scott Baldwin (72), Aaron Jarvis for Paul James (72), Tomas Francis for Samson Lee (53), Ross Moriarty for Justin Tipuric (72), Lloyd Williams for Jamie Roberts (79), Rhys Priestland for Dan Biggar (73), James Hook for Liam Williams (73).
Unused: Jake Ball.
Sin bin: Alex Cuthbert (76)
Australia: Israel Folau; Adam Ashley-Cooper, Tevita Kuridrani, Matt Giteau, Drew Mitchell; Bernard Foley, Will Genia; Scott Sio, Stephen Moore (capt), Sekope Kepu, Kane Douglas, Dean Mumm, Scott Fardy, Sean McMahon, David Pocock.
Replacements: Tatafu Polota-Nau for Stephen Moore (66), James Slipper for Scott Sio (62), Greg Holmes for Sekope Kepu (55), Rob Simmons for David Pocock (59), Ben McCalman for Sean McMahon (48), Nick Phipps for Will Genia (67), Matt Toomua for Matt Giteau (66), Kurtley Beale for Drew Mitchell (66).
Sin bin: Will Genia (55), Dean Mumm (59)
Australia weathered a Welsh storm to win World Cup Pool A with a 15-6 victory at Twickenham.