Denmark strikers Nicolai Joergensen and Martin Braithwaite struck to secure a 2-1 victory over Wales and promotion from Nations League B Group 4 in a pulsating clash on Friday.
The Welsh went behind to Joergensen's goal before the break and Braithwaite added a second late on before Gareth Bale almost immediately pulled one back, but it was too late for the hosts.
Wales looked the more dangerous side early on, displaying their aerial power at set pieces and going close on several occasions before Joergensen struck in the 42nd minute.
Winger Yussuf Poulsen started a counter-attack on the edge of his area before sprinting forward and receiving the ball from midfielder Thomas Delaney. His first-time ball found Joergensen, who slotted it through the legs of goalkeeper Wayne Hennessey.
Denmark's Kasper Schmeichel had to be at his best to keep out a stunning late free kick by Bale which he palmed away as it arrowed towards the top right-hand corner of his goal.
With two minutes of normal time remaining, Braithwaite collected a throw-in on his chest and clipped a superb volley past Hennessey, and though Bale scored the Danes held on to win.
The result put Denmark top of the group on seven points with one game left to play at home to already relegated Ireland, while Wales have finished second on six points from four games.
The Danes will now be promoted to League A and get an extra chance of qualifying for Euro 2020, which will see four games hosted at the Parken Stadium in Copenhagen, if they need it.
With just one point and one goal from three games the Irish, who play Denmark in their final game in Aarhus on Monday, are heading into League C for the next edition of the competition.