Camped on their own goal line, Australia just kept scrambling and tackling and eventually forced a penalty from a brilliant spot tackle by Adam Ashley-Cooper.
The moment was lost for Wales - and so was the game.
All the pressure built over the previous 15 minutes deflated as the ball was kicked down field. A few moments later, Bernard Foley kicked another penalty - his fifth of the night - and the score was 15-6.
The hard-fought victory underlines how hard Australia will be to beat in this World Cup and they will meet Scotland in the quarter-finals next week. Despite throwing everything at the Wallabies, Wales fell short and now have a much tougher assignment against South Africa.
Wales dominated much of the early stages of the match, turning early pressure into a 3-0 lead, after quickly recycling the ball from the ruck and gaining parity in the scrums.
And a week after demolishing England at the breakdown, the Wallabies soon learned they would not have it all their own way against the Welsh loosies who turned the ball over in Australia's first foray in their territory.
In those first 15 minutes, Australia made three times as many tackles as the Welsh and were camped inside their own half.
Yet, the Australian scrum - so often their Achilles heel - again proved a growing strength in this World Cup, earning a penalty in front of their own goal posts to relieve the pressure.
It took 20 minutes for the Australians to reach the Welsh 22 line, but turned the ball over when a maul was held up. But the Wallabies shunted the Dragons back on the subsequent scrum, earning a penalty and Bernard Foley equaled the scores at 3-3.
Neither team was able to gain the upper hand for long in the first half; either turning the ball over or conceding a penalty at the most inopportune time.
With ball in hand, Australia struggled to get over the gainline but Wales gave away a string of penalties contesting the ball on the ground and earned a final warning from referee Craig Joubert.
Foley and Biggar traded penalties to give Australia a 9-6 lead at half time.
Poor discipline continued to plague Wales after the break, when a brilliant turnover by Sam Warburton was over-ruled because of a dangerous tackle by Taulupe Faletau.
Up steps Foley and the scoreboard ticked over to 12-6.
The turning point came in the 56th minute when Will Genia was sin-binned for cynical play, stopping a quick tap penalty without retreating.
Wales spurned the penalty chance and kicked for touch. Despite drive after drive, they could not breach the Australian line - Faletau ruled to have not grounded the ball.
Then Australia was reduced to 13 men with 20 minutes to play, when lock Dean Mumm was yellow carded for infringing in a lineout drive and joined Genia on the sidelines.
Wales simply had to score from the ensuing scrum - and didn't. The Australian defence held strong and drove the Welsh back 30 metres.
Then George North made a clean break down the right-hand touch line but was held up over the line.
Defending yet another scrum on their own line, Australia with two yellow cards, and Wales still couldn't cross the line.
Australia repelled wave after wave of Welsh ball-carriers, who simply could not take advantage of their numbers, territory and possession.
Wales kept turning down shots and goal and the clock kept winding down, as Australia emptied the bench - then turned the ball over after a superb spot tackle from Adam Ashley-Cooper.
The ball was kicked downfield, the moment was lost for Wales.
Commentary
Match stats
Chalkboard
Action areas