DOHA, Qatar — Germany was eliminated from the group stage of the World Cup for the second tournament in a row.
The four-time champions beat Costa Rice 4-2 Thursday but it wasn't enough to advance to the round of 16. Japan's 2-1 victory over Spain allowed both of those teams to advance instead, with the Japanese team at the top of the group.
Playing as defending champions at the last World Cup, Germany also exited early.
Germany, which lost to Japan in its opening match in Qatar, needed help from the other match in order to advance with a victory at Al Bayt Stadium, but things didn't go its way. If Spain had beaten Japan, the Germans would have finished second in the group.
It all started so well with Serge Gnabry putting Germany in front against Costa Rica with a 10th-minute header and Spain taking an early lead against Japan at the Khalifa International Stadium in Doha.
Both matches were turned upside down in the second half.
Yeltsin Tejeda evened the score in the 58th minute and Juan Vargas scrambled another in the 70th, putting Costa Rica ahead 2-1 and on target to advance.
But Germany substitute Kai Havertz made it 2-2 three minutes later and then restored Germany’s lead in the 85th. Another substitute, Niclas Füllkrug, added the fourth.
The match was also notable because French referee Stéphanie Frappart became the first woman to officiate a men’s World Cup match.
Japan will next face Group F runner up Croatia and Spain will face Group F winner Morocco.