Germany is out of the World Cup, the fourth defending champion in the last five tournaments to be eliminated in the group stage.
The four-time champions lost to South Korea 2-0 in Kazan, Russia, on Wednesday, allowing a pair of injury-time goals while knowing a 1-0 victory would have been enough to advance because of the result in the other group match.
Germany ended up last in Group F while Sweden and Mexico advanced to the round of 16. South Korea was also eliminated despite the victory.
Mexico’s World Cup is alive but only by the thinnest of margins.
Playing in Yekaterinburg, the easternmost World Cup city, on the border between Asia and Europe, Sweden got second-half goals from Ludwig Augustinsson, Andreas Granqvist and an own goal contributed by Mexican defender Edson Alvarez to stun Mexico 3-0.
But South Korea — and American referee Mark Geiger — rescued El Tri with Kim Young-gwon’s goal in extra time to beat defending champion Germany and save Mexico’s spot in the knockout round.
Fielding a side filled with reserves, Croatia ended Iceland's first World Cup run with a 2-1 win in Rostov-on-Don, Russia.
Milan Badelj crashed a volley against the bar, and moments later scored for Croatia in the 53rd minute, sprinting into the area to fire a bouncing shot past goalkeeper Hannes Halldorsson.
Croatia playmaker Luka Modric led the already-qualified Croats for 65 minutes before being taken off, as his team remained in low gear for most of the match to contain the Icelanders, who had needed a win to hope for a place in the last 16.
France got what it wanted and Denmark got what it needed Tuesday on the final day of play in Group C at Moscow’s Luzhniki Stadium.
What neither team got, however, was a goal. Not that it mattered, since the first scoreless draw of the World Cup was enough to give France the group title and Denmark a berth in the second round as runner-up when Peru beat Australia 800 miles away in Sochi, eliminating the Aussies.
France and Denmark will learn their opponents in the knockout stage after the final two Group D games later Tuesday.
Peru has won its first game at the World Cup since 1978 with a 2-0 victory over Australia on Tuesday in the last match of Group C play.
Veteran striker Paolo Guerrero assisted on the first goal when Andre Carrillo volleyed the cross and beat Australia goalkeeper Mat Ryan in the 18th minute. Guerrero then got a goal of his own in the 50th minute, finishing a deflected cross from Christian Cueva. It was Peru's first win since beating Iran in the 1978 tournament. They were winless in their previous eight World Cup matches but had not been in the tournament since 1982.
The Peruvians are going out on a high note this time, though, delighting the thousands of fans who made the trip from South America and flooded every city and stadium where they played. Carrillo's goal started Peru's party, and it only became louder and more joyful after Guerrero found the net.
Cristiano Ronaldo's missed penalty cost Portugal first place in its World Cup group on Monday.
Portugal finished second in Group B after a 1-1 draw with Iran. The 2016 European champions will next face Uruguay on Saturday in the round of 16.
Instead of Ronaldo, it was Ricardo Quaresma who scored for the Portuguese. The 34-year-old midfielder responded to his first start of the tournament by producing one of the more aesthetically pleasing goals of group play.
It has been a difficult tournament so far for reigning champion Germany, which lost its opener to Mexico then needed a goal deep in stoppage time to beat Sweden, keeping alive its hopes of reaching the knockout round.
Now it needs another win if it hopes to continue a streak of never exiting a World Cup in group play, although with the right circumstances, it could also advance with a draw.
Winless South Korea also has a path — albeit a narrow one — open to the second round. The easiest way through would be for the South Koreans to win and Sweden to lose, creating a three-way tie for second that would be broken on goal differential. If Sweden loses and South Korea beats Germany by two or more goals, the Koreans finish second.