The Germans fought back from conceding an early goal to get their Euro 2020 campaign up and running after a loss in their first group game with a result that saw them draw level on three points with Portugal after two matches apiece.
In a pulsating, action-packed encounter played out amidst searing heat in Munich, it was defending champions Portugal who made the early breakthrough through Cristiano Ronaldo’s 15th minute strike.
Bernardo played a key role in the goal, superbly picking out Diogo Jota in the area.
One on one with Germany keeper Manuel Neuer, the Liverpool man fed Ronaldo who made no mistake to register his 107th international goal.
However, with Gundogan a steady reassuring figure at the heart of midfield, the hosts made the most of the let off by roaring back to strike twice inside four minutes as they took control of the tie via two own goals.
The leveller arrived on 34 minutes, Robin Gosens volleyed a cross back into the danger area with the ball being directed goalwards by Kai Havertz with TV replyas showing it went in off the unlucky Dias.
Another own goal followed on 38 minutes as Portugal full back Raphael Guerriero could only inadvertently send the ball into his net off his shins following Joshua Kimmich's cute cutback.
Six minutes after the restart Germany further extended their lead when Havertz converted from another fine Gosens cross.
The game as a contest was then effectively signed and sealed on the hour when Gosens capped a fine individual display by heading home from Kimmich’s inviting cross.
Portugal though did summon up another goal of their own, Jota firing in from close range after Ronaldo had hooked the ball back into the box.
With France having been held to a 1-1 draw by Hungary in the day’s earlier fixture, it means Group F is still wide open ahead of next week’s final fixtures with the French on four points, Germany and Portugal both on three and Hungary on one.
Germany play Hungary while France tackle Portugal in next Wednesday’s final decisive games.