Louis Rees-Zammit marked his first Wales start in two years by scoring in a dramatic 24-23 victory over Japan.
The Bristol Bears wing from Penarth claimed his 15th international try during the second half at the Principality Stadium in Cardiff.
But the headlines belonged to replacement Jarrod Evans, whose last-gasp penalty ended a ten-game wait for victory on home soil and a first win under new head coach Steve Tandy.
Crucially, it also means Wales will avoid a potential group of death at the 2027 Rugby World Cup, with the draw being made next month.
But despite the heroics, Tandy said the result shouldn't have been so close as Eddie Jones' Brave Blossoms came so narrowly close to a first ever win in Wales.
"We've got to be smarter", he said. "And that's where, if I'm being brutally honest, we're at. We've spoken all week about our performance being better than last week. I think we showed elements of smartness and bravery in certain parts of the game."
For Rees-Zammit's part, the one-time NFL hopeful came close to scoring shortly before half time when Japan had been briefly reduced to 13 men - only for the ball to slip from his grasp as he paced from the Wales twenty-two to Japan's 10m line.
The early stages of the second half saw Wales reduced to 14 men after Josh Adams' yellow card was upgraded to red for 20 minutes for a dangerous clearout.
Rees-Zammit's first try in Welsh colours since 2023 came after a Lee Seung-sin penalty as the pressure allowed him to dive over the line with Dan Edwards adding the extras.
The lead would change hands another four times, ending with Evans' kick that allowed for a rare euphoric moment for Welsh rugby.
The Harlequins fly-half told the WRU's website: "We knew we had one best chance to win the game. The boys had faith in each other and in our simple plan to protect possession and move up the field."
The Autumn Nations Series continues on Saturday as New Zealand visit Cardiff, aiming to bounce back from their 33-19 defeat to England at Twickenham.

Barry game postponed over travel concerns
Llantwit game rained off
Rees Zammit starts in crucial Japan test
Bevan named player of the month
Barry visit Cambrian United in MG Cup semis
Barry Town to unveil new club strategy
Bombers improve against the Buns
Barry Ladies reach Trophy last eight
Leaders Penarth held at Llanharan
All square again for Barry
Rees-Zammit on bench for Wales return
Llantwit up for Cymru South awards
Barry through to MG Cup semi finals
Young Bombers rally with Llandaff win
Barry cruise to Colwyn Bay win