First-half goals for Kasper Dolberg and Andreas Skov Olsen put the Danes firmly in the frame to reach next year's final four, only for rival Croatia to net twice in the second half to beat Austria and finish top of Group A1.
Nevertheless, an assured victory over World Cup holder France in Copenhagen offered a sharp reminder of Denmark's dark horse credentials for Qatar, after also reaching the Euro 2020 semi-finals.
Austria's defeat ensured Les Bleus dodged relegation to the second tier, but for Didier Deschamps, alarm bells may be ringing after a lacklustre campaign.
With the risk of the drop breathing down their necks, it was the visitors who started sharpest, with Kylian Mbappe and Antoine Griezmann delivering early tests for Kasper Schmeichel.
Yet Denmark steadily gained ground, and when Dolberg lunged by the left post to meet Mikkel Damsgaard's cross and bobble a finish over Alphonse Areola in the 34th minute, its lead was not an unworthy one.
Olsen's rocket of a volley through a crowded box after a poorly fielded corner was a fine finish too, five minutes later, and it was France who went into the sheds on the back foot.
Attempts to fight back after the interval were frequent, if speculative, with Mbappe almost catching Schmeichel out twice, but Denmark's game management proved too shrewd to be broken, seeing them through for a famous win.