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 defeats 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.
A cagey opening
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.
We have lift-off
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.
A bitter pill to swallow
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.
Man of the match
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.