The Republic of Ireland have been relegated to League C of the Nations League.
Denmark's 2-1 victory in Cardiff ensured Martin O'Neill's men will finish bottom of Group 4 regardless of the result in Aarhus on Monday night, when Ireland will conclude their fixtures with a clash against the Danes.
Defeats home and away to Wales as well as a goalless draw against Denmark in Dublin have Ireland on one point. Wales - with no games left to play - have six, and Denmark are on seven. Age Hareide men have won the group.
Ireland will now be third seeds for Euro 2020 qualifying, meaning a harder group and tougher path to a tournament which will play four games in Dublin.
Nicolai Joergensen and Martin Braithwaite struck to secure the victory over Wales and promotion for the Danes in a pulsating clash.
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 setpieces 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 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.