Australia 25-23 Wales
Australia (13) 25
- Tries: Horne
- Cons: Barnes
- Pen: Barnes (5), Harris
Wales (7) 23
- Try: North, Davies
- Con: Halfpenny (2)
- Pens: Halfpenny (3)
Replacement Mike Harris's dramatic last-gasp penalty in the second Test denied Wales a first win over Australia in their own back yard for 43 years.
George North's close-range try from the base of a maul gave Wales the lead but Berrick Barnes's class set up Rob Horne to give the hosts an interval lead.
Jonathan Davies's long-range try restored Wales's lead before Barnes and Leigh Halfpenny traded penalties.
Wales led into added time but their indiscipline was punished by Harris.
The Queensland Reds fly-half, who replaced the injured Barnes just moments before, stepped up to slot a tricky penalty over from the left-hand touch-line.
Wales were penalised by referee Chris Pollock for a collapsed maul and Harris's composed kick secured Australia a thrilling victory in Melbourne as the Aussies took an unassailable 2-0 lead in the three-Test series.
Wales's Australia tour
Saturday, 9 June: Australia 27-19 Wales (Suncorp Stadium, Brisbane)
Tuesday, 12 June: Brumbies 15-25 Wales (Canberra Stadium, Canberra)
Saturday, 16 June: Australia 25-23 Wales (Etihad Stadium, Melbourne)
Saturday, 23 June: Australia v Wales (Aussie Stadium, Sydney; 06:00 BST)
The Welsh snatching defeat from the jaws of victory in added-time was a cruel blow for the 2012 Grand Slam winners as they had possession of the ball with a minute remaining.
But Rhys Priestland kicked away possession to crucially allow Australia one last chance that Harris, playing his second international, clinched.
Wales have only ever beaten a Tri-Nations super-power twice in the southern hemisphere and their only win over the Wallabies in Australia was back in 1969 - but this side of 2012 should have ended four decades of hurt.
The faultless boot of Halfpenny kicked 13 points gave Wales hope as the Cardiff Blues full-back extended his 100% kicking record on this tour, despite being dumped on his head when Cooper Vuna was sin-binned for dangerous play.
Kicking rival Barnes, however, was also impeccable as Australia's fourth choice fly-half celebrated the birth of his first child Archie with a 17-point haul under the Etihad Stadium roof to give Australia a platform.
Wales's habit of being slow starters was a reason behind their first Test defeat in Brisbane last Saturday but they certainly began with a point to prove in Melbourne as North scored inside the opening four minutes.
The visitors' powerhouse wing picked the ball up at the base of a breakdown and bulldozed past two covering defenders to score his 11th try in 23 internationals from two metres out before Halfpenny converted.
The Welsh had another sight of the line as Mike Phillips burst out of his own half before finding Rhys Priestland in support but the fly-half was unable to release Sam Warburton for the try.
Barnes dragged Australia back into the game as his trusty boot penalised Welsh indiscipline by kicking two penalties and a moment of magic by the Aussie fly-half just before half-time ensured the hosts led at the break.
Wales's Tri-Nations wins in Southern Hemisphere
- 21 June 1969: Australia 16-19 Wales (Sydney)
- 18 June 1987: Australia 21-22 Wales (Rugby World Cup third-placed play-off, Rotorua)
Barnes darted towards the Welsh line, sold Ashley Beck a dummy to split the Welsh backline and he fed Horne who ran in his second international try unopposed before the fly-half slotted over the conversion.
It had been coming as Wales lost a succession of line-outs on their own throw as the pressure mounted.
The visitors, though, were ahead again within five minutes of the restart as a loose pass by Will Genia, the Australian mastermind last week, to Digby Ioane was capitalised on by Wales.
Beck hacked the bobbling ball upfield and midfield partner Davies - who, like North, had not scored for Wales since their Six Nations opener in Ireland in February - showed some delicate footwork to finish.
The Scarlets centre beat Rob Simmons in the foot race, touching down for a try that the reliable Halfpenny converted.
Halfpenny and Barnes exchanged penalties as the lead changed 10 times but Australia were dealt a blow when Vuna was yellow carded for a clumsy challenge on Halfpenny in the air.
But Halfpenny got straight back to his feet to crack over a huge 40-yard penalty as Wales regained the slender lead.
Barnes hit back after Bradley Davies was penalised but Halfpenny was again on target with another penalty as Welsh pack dominated.
But Wales prop Gethin Jenkins was penalised inside his own half and Barnes stepped up to take what looked like a simple sixth penalty.
The fly-half, however, was suffering with a groin strain so pushed his effort wide and was quickly replaced by Harris.
The move proved inspired as the New Zealand-born 23-year-old stepped up to break Welsh hearts.
Australia : Adam Ashley-Cooper (NSW); Cooper Vuna (Melbourne), Rob Horne (NSW), Pat McCabe (ACT), Digby Ioane (Queensland); Berrick Barnes (NSW), Will Genia (Queensland); Benn Robinson (NSW), Tatafu Polota-Nau (NSW), Sekope Kepu (NSW), Rob Simmons (Queensland), Nathan Sharpe (Western Force), Scott Higginbotham (Queensland), David Pocock (Western Force, capt), Wycliff Palu (NSW).
Replacements : Stephen Moore (ACT), Ben Alexander (ACT), Dave Dennis (NSW), Michael Hooper (ACT), Nic White (ACT), Anthony Fainga'a (Queensland), Mike Harris (Queensland).
Wales : Leigh Halfpenny (Blues); Alex Cuthbert (Blues), Jonathan Davies (Scarlets), Ashley Beck (Ospreys), George North (Scarlets); Rhys Priestland (Scarlets), Mike Phillips (Bayonne); Gethin Jenkins (Toulon), Matthew Rees (Scarlets), Adam Jones (Ospreys), Bradley Davies (Blues), Alun Wyn Jones (Ospreys), Dan Lydiate (Dragons), Sam Warburton (Blues, capt), Ryan Jones (Ospreys).
Replacements : Richard Hibbard (Ospreys), Paul James (Ospreys), Luke Charteris (Perpignan), Justin Tipuric (Ospreys), Rhys Webb (Ospreys), James Hook (Perpignan), Scott Williams (Scarlets)