Four-time champions Germany have crashed out of the football World Cup in Qatar in the group stage, despite a 4-2 victory over Costa Rica.

Germany finished third in the standings, level on four points with Spain but behind on goal difference and will return home early like they did in 2018.

Japan topped Group E with six points following their 2-1 win over the Spaniards and will face Croatia in the last 16 while Spain will take on Morocco. Costa Rica finished last on three points.

It is the second World Cup in a row in which Germany have been eliminated in the group stage. Germany finished third in the Group E standings, behind Spain on goal difference, with Japan top following their 2-1 win over the Spaniards. The result left Japan facing Croatia in the last 16, while Spain will take on Morocco.

Thursday’s game was also historic as it was the first men’s World Cup game to be refereed by a woman. Three of the four match officials – France’s Stephanie Frappart, Brazil’s Neuza Back and Mexico’s Karen Diaz Medina – were women.