Lars Bender struck with 10 minutes to go to seal Germany's place in the Euro 2012 quarter-finals and send Denmark home.
The game was 1-1 at the break with Denmark needing a win to progress as Portugal were also level with the Netherlands in the other Group B clash.
Germany began the half in the ascendancy with Thomas Muller and Mario Gomez spurning good opportunities to break the deadlock.
Mesut Ozil wasted a promising position from a free-kick and Sami Khedira posed questions of the Danish defence supplying chances for his teammates.
The Danes had few chances, with Nicklas Bendtner providing Germany keeper Manuel Neuer with a simple catch from a tame header.
Germany eventually broke the deadlock on 19 minutes when Lukas Podolski thundered in a strike from the edge of the area to mark his 100th cap.
Michael Krohn-Delhi equalised just six minutes later after heading home from close range.
After the re-start Bendtner had a strong case for a penalty which was waved away by the official.
Germany could have won by more in the end but never really got out of second gear. They advance through as winners of Group B and will face Greece in the quarter-finals.