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 for the second World Cup in a row.

It means Japan top Group E, and Spain come second, with Costa Rica also failing to qualify.

Sky Sports’ Charlotte Marsh said: “It’s quite inconceivable that Germany would exit at the group stage in two successive World Cups – but it’s happened.

“It has been a litany of failures at the tournament since their 2014 win in Brazil, but you cannot say that just because of their pedigree, Germany deserved a spot in the knockout rounds.

“Given their chances created – especially against Japan and Costa Rica – they should have cruised into the last 16. But errors in midfield and defence ultimately proved to be their downfall.”