The Wallabies battled on after losing star backs Quade Cooper and Kurtley Beale with first-half injuries to edge out the Welsh with magnificent defence after both teams scored two tries each.
It was Australia’s first win at Eden Park since 1986, but not against their Bledisloe Cup rivals New Zealand, who take on France at their fortress in Sunday’s final.
Both teams managed a final effort after shattering semi-final defeats last weekend, the Wallabies going down 20-6 to the All Blacks, while the Welsh lost 9-8 to France after playing with 14 men for the last hour.
This victory meant two-time champions Australia won their first bronze at the World Cup after losing 22-21 to Wales in the playoff for third place at the inaugural 1987 tournament in New Zealand.
“We came to the tournament to win obviously but we weren’t good enough by some distance against New Zealand,” said Australia coach Robbie Deans.
“It’s not easy, the blokes were pretty disappointed, it (the third place playoff) is not the match of their preference.
“But, having said that, it’s still an opportunity to represent your country and you saw tonight from both sides the pride they have in that.”
Wales, also coached by a New Zealander in Warren Gatland, were without suspended captain Sam Warburton following his sending off against France for a dangerous ‘tip tackle’ on Vincent Clerc.
But, for the second match in a row, Wales also missed injured fly-half Rhys Priestland with wayward goalkicks, as they had against France, costing them dear.
“I think you’ve got to be pretty proud of what we’ve done in this tournament but take nothing away from Australia, they deserved to win,” said Gatland.
“At this level you’ve got to kick your goals. We didn’t do that and we’ve come up three points short.”
Australia’s Berrick Barnes, who shifted into the fly-half slot following Cooper’s injury in the 22nd minute, delivered a masterly performance and was named man-of-the-match.
New Zealand-born Cooper, booed every time he touched the ball, was having one of his better games in a erratic tournament before he collapsed to the ground, clutching his right knee, while running the ball inside the Welsh quarter.
The Wallaby fly-half was led from the ground, his tournament over, but this time to applause from the crowd.
Beale had earlier lasted just nine minutes before re-aggravating a hamstring injury that saw him miss the semi-final.
Cooper had set-up the opening try in the 12th minute, his pass splitting Jamie Roberts and Jonathan Davies and allowing Barnes to stroll over untouched for what became a 7-0 lead when James O’Connor converted.
Prop James Slipper was penalised in the scrum for James Hook to kick a penalty for Wales.
Hook then badly missed an easy penalty attempt five minutes after the restart.
Australia lock Nathan Sharpe’s 100th Test match finished six minutes into the second half interval after he had bravely soldiered on from knee trouble in the opening five minutes.
Wales hit the front with a fortuitous Shane Williams try in the 49th minute off what appeared to be a forward pass from Hook but English referee Wayne Barnes waved play on.
Hook’s pass was toed ahead by wing Williams who regathered to dot down in the left corner.
But the Wallabies hit back with two quick O’Connor penalties off ruck infringements to lead by five points as the Welsh found it difficult to breach the resolute Australia defence.
Berrick Barnes, running the show for the Wallabies, potted a drop goal to put his team 16-8 ahead with 12 minutes left.
Substitute fly-half Stephen Jones kept Wales alive with a 71st minute penalty.
But the Wallabies finished the better with No 8 Ben McCalman surging over for their second try four minutes from time.
Wales managed a converted try to full-back Leigh Halfpenny in injury time but all it did was reduce the Wallabies’ victory margin.