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.

Dinas build momentum with Fairwater win
Penarth out of Division One Cup
Swans hit Barry Ladies for seven
Bombers stun Llanishen with late show
Kenyan safari for Barry bowlers
Barry rout Brynmawr in youth friendly
Barry beaten in phase two opener
Llantwit rained off again
Llantwit sign keeper Gardiner
Wharton returns to Barry Town
Grady recalled for Six Nations
Llantwit visit Treowen in WBS Cup quarter finals
Talks to be held on Cardiff Rugby sale
Llantwit reach WBS Cup quarter finals
Barry kick off Phase Two at TNS
Vale teams join in Cardiff clubs' day