Germany's goalkeeper Manuel Neuer (R) clears the ball during the World Cup group E match at the Al Bayt Stadium in Al Khor , Qatar, on Thursday. AP
Spain qualified on goal difference to the round of 16 alongside Japan, while Germany and Costa Rica failed to reach the next stage of the 2022 FIFA World Cup.
In the final fixtures of group E, Japan beat Spain 2-1 in a thrilling match that saw the two national teams advance to the round of 16, while Germany overcame Costa Rica 4-2 to no avail, as both teams missed their chance to qualify.
Germany crashed out of the World Cup at the group stage for the second time in succession despite a 4-2 win against Costa Rica on Thursday.
The four-time World Cup winners came into the match needing a win but were also relying on the result of Japan's game with Spain to progress.
But the Germans were eliminated due to goal difference as Japan followed up their defeat of Germany with another shock result by beating Spain 2-1.
A German supporter cheers before the World Cup group E match between Costa Rica and Germany. AP
Germany took an early lead but briefly fell behind in the second half as coach Hansi Flick made a flurry of changes, reacting to the live score of the Japan v Spain fixture.
The Germans started positively, with Flick's all-Bayern Munich front line turning the screws early, battering the Costa Rica defence before Serge Gnabry got his head to a curling cross from Leipzig defender David Raum after 10 minutes to open the scoring.
Midfielder Leon Goretzka almost doubled Germany's lead just five minutes later but his header was directly at Keylor Navas.
Complacency began to creep into Germany's game. Keysher Fuller, Costa Rica's goal-scoring hero in a 1-0 win against Japan, forced Manuel Neuer into a fingertip save after some half-hearted defending from Raum and Antonio Ruediger.
Flick moved Kimmich back to his familiar defensive midfield position at half-time, bringing on Lukas Klostermann at the expense of Goretzka, who like Kimmich started the match on a yellow.
Just seven minutes into the second half, word crept around the vast Lusail Stadium that Japan had scored two quick goals to take the lead against Spain, a result which would force Germany out of the tournament.
Flick reacted immediately, bringing on Niclas Fuellkrug and taking off another midfielder in Ilkay Gundogan.
Germany appeared disjointed as Costa Rica went on the counter on the 58-minute mark, the ball rebounding off Neuer and into the path of Yeltsin Tejeda, who slammed it home.
Flick continued to chase the game, making more changes but it was Costa Rica who scored next when Juan Pablo Vargas tapped a free kick past Neuer to put his side past Spain and into the Round of 16. The goal was later recorded as an own goal.
Germany hit back minutes later through Chelsea forward Kai Havertz to draw level.
Havertz scored again in the 86th minute and Fuellkrug added another in the 89th minute to bring the score to 4-2, but the side's focus remained nervously fixed on the group's parallel fixture.
The night ended with Germany losing out to second-placed Spain on goal difference.
It means Germany, who had not missed out on the knockout stages of a World Cup for 80 years until the 2018 tournament in Russia, have been bundled out in the group stage for the second World Cup in a row.
While Saudi Arabia doesn’t have a big star like Messi or Cristiano Ronaldo, many of the players were also part of the squad that went to the 2018 World Cup. But none play outside of their home country.
More than 30,000 Argentina fans are in Qatar for this year's tournament and while many worship current number 10 Lionel Messi, Maradona's name still carries an almost mystical force.
Another favoured team has failed to impress in the early stages of the World Cup. This time it was South Korea holding South American power Uruguay to a 0-0 draw on Thursday, a result that probably favours the Asian team.
As the five-time champions prepared to take the pitch for their opening match against Serbia, the 82-year-old icon posted a series of photos of his past World Cup glories on Instagram, telling Neymar and his teammates: "Today we start writing a new story."
Taking place under the patronage of Sheikh Nahayan Bin Mabarak Al Nahayan, the event will be contested by 17 teams with some of the top names in the badminton world including Olympic medallists to lead their respective teams.
Aurelien Giraud, the French skateboarder, won the men’s Street 2022 World Championships at Aljada Skate Park in Sharjah, while Brazilian 15-year-old Rayssa Leal claimed gold in the women’s event.
The defending champions are alleged to have breached league rules requiring provision "in utmost good faith" of "accurate financial information that gives a true and fair view of the club's financial position".