Host nation Germany progressed into the Euro 2024 quarter-final thanks to a second-half Kai Havertz penalty and a second goal from Jamal Musiala.
However, Denmark will feel aggrieved about their exit after Joachim Andersen thought he had given his country a 48th-minute lead, only for VAR to rule it out for offside.
Just two minutes after seeing his goal chalked off, Andersen was then judged by VAR to have handled a cross into the box and Havertz dispatched the spot kick.
Germany sealed their quarter-final spot as Nico Schlotterbeck sent a floated ball into the path of Musiala who calmly fired home.
The home nation could have added to the score-line late on, but were met by a determined Kasper Schmeichel performance.
Germany will now face either Spain or Georgia in the quarter-final.