Wales pulled off an improbable return to the Nations League's top tier as they came from behind to beat Iceland convincingly in Cardiff – with Montenegro's win over Turkey helping secure promotion for Craig Bellamy’s side.
Turkey had started the night at the summit of Group B4, with Wales two points behind in second place and Iceland a further two points back in third.
Needing to win at Cardiff City Stadium while also hoping for a favour from Montenegro, Welsh hopes took an early hit as Andri Gudjohnsen fired Iceland ahead in the seventh minute, following up sharply after Wales goalkeeper Danny Ward had made a brilliant save from Orri Oskarsson's header.
But Liam Cullen's first two international goals – one from Brennan Johnson's inviting cross, the second helping Daniel James' half-saved shot over the line – put Wales in front at half-time.
Cullen set up Johnson to score Wales' third with a cool finish after the break, before Harry Wilson struck his fourth goal in five international appearances with a sumptuous dipping effort from 20 yards.
Andri Gudjohnsen put Iceland ahead after just seven minutes in Cardiff
The fourth Wales goal fuelled an already jubilant atmosphere at Cardiff City Stadium, where fans chanted "Montenegro" as well as celebratory songs about their own team.
Victory means Bellamy remains unbeaten in his six games so far as Wales head coach, and the result has implications for next year's World Cup qualifying campaign.
Winning their group enhances Wales' chances of securing at least a play-off spot, while avoiding the Nations League play-offs means their bid to reach the 2026 World Cup in the United States, Canada and Mexico could start as early as March.
When Bellamy was appointed in the summer, he declared that getting Wales to the World Cup was his ultimate goal.
While the former Liverpool and Manchester City forward said the primary aim for this Nations League campaign was to prepare for World Cup qualifying and instil a clear playing identity, securing promotion to the top division at the first attempt represents a significant achievement in itself.
Had Wales not won Group B4, they would have faced a Nations League promotion play-off in March, meaning their World Cup qualifying campaign would be pushed back to June or September next year.
What Wales were not contemplating was a home defeat against Iceland which would consign them to third place and a relegation play-off.
However, just seven minutes in, that possibility was staring them in the face as Iceland took an unexpected lead.
Ward did superbly to claw away a header from the unmarked Oskarsson but Gudjohnsen – son of former Chelsea forward Eidur – reacted quickly and drilled a low shot between the Wales keeper's legs.
That was the first goal Wales had conceded at home for 321 minutes, a run stretching back to their 4-1 thrashing of Finland in their Euro 2024 play-off semi-final in March.
This was also the first time Wales had fallen behind under Bellamy.
They responded well and, despite some uncertain moments in defence, Wales were level 25 minutes later as Johnson's curling left-footed cross from the right was glanced in by Cullen.
Iceland, who had fought back from 2-0 down to draw with Wales in Reykjavik last month, still posed a threat, with Gudjohnsen missing the target with two shots inside the box.
But Wales were more clinical – and a touch more fortunate – in front of goal as they scored in first-half stoppage time.
After Wilson won possession with a fine tackle, Mark Harris threaded a through ball to James, whose shot was partially saved by Hakon Valdimarsson before Cullen slid in to score from close range.
With Montenegro leading Turkey 2-1, Wales stood at the top of Group B4 at half-time, promotion in their sights.
An open start to the second half produced chances at both ends, Ward tipping over a shot from Mikael Ellertsson and Valdimarsson doing the same with a Ben Davies header.
The attacking intent of the two sides left plenty of space behind both defences, which made the game as entertaining as it was ragged.
Jon Dagur Thorsteinsson squandered a couple of promising positions for Iceland, either side of a Welsh counter-attack which finished with Wilson shooting straight at Valdimarsson.
Wales were ruthless the next time they broke, as Cullen played in Johnson, who took a touch and composed himself before stroking the ball into the bottom corner.
"We are top of the league," chanted the Wales fans as news reached the Canton Stand of Montenegro's lead over Turkey.
They followed that with a chant of "Montenegro" as Turkey fell further behind, and the party atmosphere went up a notch again as Wilson added to his ever-expanding catalogue of spectacular goals with a typically stylish long-range left-footed strike.