Germany survived a scare to finish top of Group A at Euro 2024 as Niclas Fuellkrug's stoppage-time goal rescued a 1-1 draw against Switzerland, while Scotland were eliminated after a last-gasp 1-0 defeat against Hungary whose striker Barnabas Varga suffered a sickening injury.
Dan Ndoye's first-half goal in Frankfurt had put Switzerland on course to climb above hosts Germany into top spot.
But Fuellkrug's late header ensured Julian Nagelsmann's side advanced to the last 16 in pole position with seven points.
The Germans, who last won the Euros in 1996, will take on the Group C runners-up – currently slated to be Denmark – in the last 16.
Denmark, two points behind leaders England, play Serbia in their last group game on Tuesday.
Germany are also on track for a potential quarter-final clash with Spain, who have been among the best teams at the tournament so far.
Switzerland, who reached the quarter-finals at the last Euros in 2021, have now made the knockout stage in six successive major tournaments.
As Group A runners-up with five points, the Swiss will face the second-placed team in Group B in the last 16.
In Stuttgart, Scotland were unable to secure the victory that would likely have taken them into the knockout stage of a major tournament for the first time.
Steve Clarke's team, who lost to Germany and drew with Switzerland in their first two games, were sunk by a goal 10 minutes into stoppage-time from Kevin Csoboth, whose clinical finish capped a rapid raid from the Hungarians.
Hungary may not secure a last 16 berth despite their victory as they have only three points from their three games.
The four third-placed teams with the best records from the six groups will move into the last 16.
Hungary's win came at a cost as Varga was stretchered off after a sickening collision.
Varga collapsed to the pitch and was struggling to move after chasing a long cross into the area as Scotland goalkeeper Angus Gunn came to collect the ball.
After a long delay, medics took the 29-year-old from the pitch while a sheet was draped around the stretcher.
Hungary captain Dominik Szoboszlai appeared to be in tears as he consoled his stricken teammate.
Varga was immediately taken to hospital after the incident where he was said to be conscious and talking.
"The condition of Barnabas Varga is stable," the Hungarian Football Federation (MLSZ) wrote on X.
"The Hungarian national team player is currently in one of the hospitals in Stuttgart. We will inform you immediately if there is any news on his status." (AFP)