Rhys Priestland kicked a dramatic 83rd-minute penalty as Wales secured a third consecutive victory against Australia for only the second time in their history.
An eventful first-half saw Australia make a dream start as Andrew Kellaway crossed for an early try before they were reduced to 14-men when Rob Valetini saw red for a high tackle.
Dan Biggar’s boot cut the gap and after Australia lost Kurtley Beale to the sin bin, Ryan Elias scored his third try in two games to give the home side the lead for the first time.
Biggar and James O’Connor traded further penalties before the Welsh No.10 edged his side 16-13 ahead at the break but the Wallabies refused to go away in the second half.
Nick Tompkins benefitted from a favourable bounce to run in an interception after the restart and while Nic White crossed in response, Biggar kept the home side in front from the tee.
Australia then retook the lead with a stunning finish from Filipo Daugunu and a lengthy penalty from Beale, only for Priestland to step up and send the 68,112 fans into raptures with the last kick.
RED CARD SHIFTS MOMENTUM
The last time the Wallabies visited Principality Stadium in 2018, Wales prevailed 9-6 in a nerve-shredding encounter to beat Australia for the first time since 2008.
But the chances of another low-scoring affair were blown out of the water inside two minutes as the visitors raced into an early lead courtesy of wing sensation Kellaway.
The 26-year-old – nominated for World Rugby’s Breakthrough Player of the Year award earlier in the week – pounced on a no-look grubber from Hunter Paisami to dot down.
O’Connor just sneaked his conversion inside the post to quieten the home crowd again, although it took no time at all for the Six Nations champions to find a response.
From the restart, Wales were awarded a penalty for obstruction and Dan Biggar obliged from the tee on five minutes to cut the deficit and give the home faithful reason to cheer.
The early running was all Australia though as Dave Rennie’s men showed plenty of variety in their play and piled the pressure on up front, forcing a penalty from the second scrum.
It looked like Wales would be in for a tough evening until momentum shifted in their favour on 15 minutes when Valetini was shown a straight red card for a high tackle on Adam Beard.
Biggar converted the penalty and while the Wallabies hit straight back through O’Connor after Willis Halaholo was penalised at the breakdown, the tide was beginning to turn.
Australia found themselves down to 13 men on 22 minutes as Wales enjoyed their first significant attack, with Kurtley Beale shown yellow for a deliberate knock-on as Tompkins looked to put Louis Rees-Zammit in for a try in the right corner.
Wales took advantage immediately from the resulting penalty lineout, winning their own throw before Tomos Williams slipped the ball inside to Elias to cross in the same corner.
Biggar was on target from the touchline as the hosts took the lead for the first time but it did not last long as O’Connor levelled the scores just before the half-hour mark.
The rest of the half became increasingly stop-start as a collision between Josh Adams and Kellaway forced a lengthy delay before Wales retook the lead on the cusp of the interval through Biggar’s boot after an excellent weaving break from Halaholo.
WALES OVERCOME STUBBORN WALLABIES
Wales started the second half much like Australia did the first, playing with high tempo as an early break from Liam Williams from fullback set the tone for what was to come.
And the hosts got their just reward on 47 minutes as a fortunate Tompkins interception bounced backwards and allowed the centre to run in a simple try under the posts.
Biggar made no mistake with the extras to extend Wales’ lead to ten points but riled by the Tompkins’ score, the fired-up Wallabies looked for an instant response.
They were gifted a chance straight from the restart as Halaholo knocked on, only for Wales skipper Ellis Jenkins to stop the maul in its tracks after Australia kicked to the corner.
Discipline then came to the fore once again on 58 minutes, with Gareth Thomas given his marching orders just moments after coming on for a clear out tackle.
With the sin-binning levelling the sides for ten minutes, Australia punished their hosts as Beale’s dazzling break set up White for his side’s second try.
The conversion cut the deficit to three points, which soon became six again after Biggar slotted another penalty having tried – and missed – a drop-goal attempt just moments earlier.
That proved to be Biggar’s last significant contribution as 34-year-old Rhys Priestland took over the No.10 shirt for the final 10 minutes to continue his international resurgence.
The return of Thomas from the bin provided the hosts with another boost but despite being restored to 15 men, Wales conceded another try as Daugunu scored in spectacular fashion on 70 minutes.
O’Connor’s conversion hit the upright to leave the home side with a narrow one-point advantage and that became a two-point deficit on 78 minutes when Beale landed a 40m penalty.
But Wales came once again and after Williams was brought down a metre short of the tryline, Priestland held his nerve to slot the winning points with the last kick of an enthralling contest.