Kasper Dolberg struck either side of half-time at the Johan Cruyff Arena, before late goals from Joakim Maehle and Martin Braithwaite capped an excellent display by the Danes.
Wales, who were one of the most-travelled squads through the tournament, saw substitute Harry Wilson sent off in the final minute.
Italy booked a last-eight tie against either Belgium or Portugal in Munich after a dogged Austria were eventually dispatched after extra-time at Wembley.
The Azzuri had looked one of the best teams in the tournament during the group stages, but found clear chances hard to come by as Austria stood firm, with a long-range effort from Ciro Immobile hitting the crossbar.
Austria, who finished as runners-up to Holland in Group C, were the better team after the break and had the ball in the net through a far post header from Marko Arnautovic – but the former West Ham striker saw his effort ruled out by VAR for offside.
Italy finally broke the deadlock in the fourth minute of extra-time when substitute Federico Chiesa fired in at the far post and Matteo Pessina drilled home a low second, before Sasa Kalajdzic headed in a late but deserved consolation.
A trip too far for valiant Wales
Only Switzerland and Sweden had travelled more miles than Wales during the cross-continent tournament, which saw them open with two group games in Baku before heading to Rome. Most of the 'Red Wall' were unable to travel to Holland, where several thousand Denmark fans made plenty of noise. Robert Page's men – with only handful of supporters in the ground and millions watching back home – showed their fighting spirit but it was not enough to deliver a return ticket to the quarter-finals.
Denmark's fairytale continues
Denmark have become a lot of people's 'second team' for the way they have responded after Christian Eriksen suffered cardiac arrest in their opening group match and had to be resuscitated with a defibrillator. While they may have qualified for the knockout stage on a wave of emotion, that should take nothing away from the fine footballing displays shown by Kasper Hjulmand's squad en route to the last eight.
Post of the day
Mancini's men march on
Italy boss Roberto Mancini had been eager to play down his side's favourites tag heading into the last 16. Despite being left frustrated for long spells by a determined Austria, the Azzuri's class eventually told. Mancini's well-drilled outfit have now surpassed the unbeaten run set by Vittorio Pozzo's side between 1935 and 1939. Just three more to go then. No pressure.
Quote of the day
Holland v Czech Republic (Round of 16, June 27, Budapest, 1700 BST)
Belgium v Portugal (Round of 16, June 27, Seville, 2000 BST)