On a thrilling night in Qatar, Japan beat Spain 2-1 in the other group game, meaning Germany’s journey was over before the knockout stages started for the second World Cup in a row.
Germany have been knocked out of the World Cup, with a win against Costa Rica not enough to secure them a place in the last 16.
Hansi Flick’s side came from behind to beat Costa Rica in their final group game 4-2.
On a thrilling night in Qatar, Japan beat Spain 2-1 in the other group game, meaning Germany’s journey was over before the knockout stages started for the second World Cup in a row.
Japan’s winning goal, which effectively knocked Germany out, was somewhat controversial, with some believing the ball went out of play before Kaoru Mitoma crossed it to Ao Tanaka, who went on to score.
However, a lengthy VAR check followed the goal, and it was ruled in Japan’s favour, with officials saying the whole of the ball had not crossed the line.
The team’s first goal was scored by Ritsu Doan with a shot from the edge of the box in the 48th minute.
The results mean Japan topped Group E, and Spain came second, with Costa Rica finishing bottom.