Niclas Fullkrug's last-gasp header saw Germany snatch a late equaliser to win their group on a night when Switzerland showed the hosts are not as all-conquering as they seem.
The early favourites were troubled for the first time this tournament by a hungry, organised Swiss side who look well worthy of dark horses status and even group winners were it not for sub Fullkrug's 92nd-minute intervention.
Germany looked to have taken the lead 75 minutes earlier when Swiss stopper Yann Sommer had VAR to thank for sparing his blushes after Robert Andrich's routine long-range strike skipped past him at the near post, only to be ruled out for Jamal Musiala's foul.
But technology did not rescue Germany when Dan Ndoye stayed onside by a whisker to bury Remo Freuler’s whipped cross for his first-ever international goal and give the Swiss a shock lead on 28 minutes.
Ndoye almost bagged a swift second moments later when his blistering speed saw him outpace Antonio Rudiger before his drilled shot fizzed inches wide. The tide quickly turned as Germany were wavering against a well-drilled Swiss side who pressed at every turn and countered so well that other teams must surely have taken note of how they can hurt Julian Nagelsmann's team.
Thomas Muller U-turns on playing for Germany after admitting being "emotional"Musiala dribbled down blind alleys and Ilkay Gundogan struggled to find space between Switzerland’s compact lines, while on Toni Kroos’ 112th cap, it was opponent Granit Xhaka who stood out as the midfield general. Jonathan Tah's booking didn't help matters and the German defender will now miss the last-16.
But the hosts emerged from the break with renewed vigour and started to click through the gears. Sommer beated away a Musiala strike and was glad to see Kroos’ shot veer horribly wide and substitute David Raum’s strike fizz over.
Germany were getting closer and it was only the outstretched boot of Manuel Akanji which denied Joshua Kimmich an equaliser from close range. But Switzerland are so well drilled and pressed Germany at every turn, chasing down every yard and fighting for every ball.
It was backs-to-the-wall stuff at times for Switzerland, but Germany's desperation almost cost them when Swiss sub Ruben Vargas found the corner of the net following a breakaway move, but only after he'd crept offside.
Kai Havertz then spurned a chance as Germany were running out of options and time, until Fullkrug's leap met Raum's cross to snatch the draw and send them through to the knockouts top of the table.
Speaking after the win, Kroos said: “I’m happy we made it in the end and won the group. We’ve shown that we believe in ourselves until the end, which is important for the team.
“I don’t think we deserved to go behind - we had good control of the game and rewarded ourselves in the end. Switzerland is a good team, but we controlled the game and conceded with the first chance. I’m totally happy with the team.”
Germany captain Ilkay Gundogan also felt the nature of the result will stand his side in good stead heading into the last-16.
“I don’t think it could have gone any better in the end,” he said. “It was a very tough game for us. We had good chances and equalised very late to win the group. We can also benefit from the importance of the equaliser in the next game.
"Today was about somehow holding our own. In terms of play, it wasn't at the level we're known for. We perhaps also hit the ball forward too early without being prepared.
Serge Gnabry learns Bayern Munich punishment after attending Paris Fashion Week"Of course we would have liked to have won the game again and worked our magic. But that can build up our strength for the next few weeks. In the end, we won the group. Unfortunately, the result often proves you right in football. It was really good for the spirit."