Germany crashed out of the Fifa World Cup on a remarkable night of drama despite victory over Costa Rica at Al Bayt Stadium.
Japan’s controversial 2-1 victory against Spain would have eliminated Germany anyway, but Hansi Flick’s side needed three points to give themselves any chance of reaching the last 16.
They completed their part of the bargain, but it was to no avail as the four-time champions finished third in the group and were eliminated on goal difference.
It could have been a different story after Japan’s winning goal in the other Group E match was initially ruled out because the officials thought the ball had gone out of play before it was put into the net, but the decision was overturned by VAR.
Germany were in complete control and in front through Serge Gnabry’s 10th-minute header, only for Costa Rica to turn the match on its head to raise the remarkable possibility of Spain also going out.
Yeltsin Tejeda equalised after Germany keeper Manuel Neuer pushed out Kendall Waston’s header in the 58th minute, before Neuer was deemed to have the final touch for the second goal 12 minutes later when Juan Pablo Vargas bundled in from close range.
At that stage, Costa Rica were going through with Japan, and Spain were heading for the exit.
It would have capped one of the most astonishing nights in World Cup history, but Germany substitute Kai Havertz restored a measure of normality with two clinical finishes to extinguish Costa Rica’s hopes of springing a major shock.
Substitute Niclas Fullkrug added a last-minute fourth to confirm victory, but it will be of no consolation as Germany failed to reach the knockout stage of the tournament for the second time in succession.
This was also a match that made history as an all-female officiating team took charge of a men’s World Cup game for the first time, with France’s Stephanie Frappart refereeing, joined by assistant referees Neuza Back from Brazil and Karen Diaz Medina from Mexico.
Shocked Germany a fallen power
Germany’s second successive exit at the group stage will come as another shock to their system and they can have no complaints as they leave Qatar.
The skids were under their campaign when they lost 2-1 to Japan in their opener and, despite showing real character to come from behind to draw 1-1 with Spain, the first-game defeat left them vulnerable.
A Germany win looked a formality as they controlled the first half hour with embarrassing ease and led through Gnabry’s strike.
Costa Rica were overpowered but Germany’s complacency gave them an entry into the game and suddenly it was they who looked like qualifying as they went ahead, although it did not last long.
Germany have some fine players in the brilliant Jamal Musiala, along with Bayern Munich’s former Manchester City winger Leroy Sane, but this World Cup may spell the end for the older generation such as goalkeeper Neuer and forward Thomas Muller.
There is certainly likely to be a lengthy inquest into another failure at the finals.
Resilient Costa Rica earn respect with fighting finish
Costa Rica looked for all the world like they were heading for a heavy defeat, in the manner of their 7-0 loss to Spain, in the opening half as they were just unable to deal with the Germans.
Only the brilliance of Keylor Navas’ goalkeeping kept Germany at bay, but what resilience Costa Rica showed to hang in and take their chances when they were presented with them.
And the world of football watched in anticipation of a gripping finale after Neuer’s own goal put them 2-1 up, leaving Luis Suarez Fernandez’s side on course for a remarkable qualification and Germany going out along with Spain.
The dream only lasted three minutes, but would have felt like an age for those two giants of the game.
Germany had too much quality for Costa Rica in the end, but what a superb effort this was and they have a victory over group winners Japan to savour on their sixth appearance at the World Cup.
Costa Rica
-
Squad number9Player nameBennette
Average rating8.23
-
Squad number22Player nameMatarrita
Average rating7.93
-
Squad number24Player nameWilson
Average rating7.92
-
Squad number17Player nameTejeda
Average rating7.74
-
Squad number8Player nameOviedo
Average rating7.74
-
Squad number3Player nameVargas
Average rating7.69
-
Squad number12Player nameCampbell
Average rating7.66
-
Squad number20Player nameAguilera
Average rating7.63
-
Squad number5Player nameBorges
Average rating7.59
-
Squad number14Player nameSalas
Average rating7.56
-
Squad number11Player nameVenegas
Average rating7.46
-
Squad number19Player nameWaston
Average rating7.41
-
Squad number7Player nameContreras
Average rating7.35
-
Squad number4Player nameFuller
Average rating7.30
-
Squad number6Player nameDuarte
Average rating7.29
-
Squad number1Player nameNavas
Average rating6.77
Germany
-
Squad number7Player nameHavertz
Average rating6.33
-
Squad number14Player nameMusiala
Average rating5.29
-
Squad number10Player nameGnabry
Average rating5.22
-
Squad number21Player nameGündogan
Average rating4.83
-
Squad number9Player nameFüllkrug
Average rating4.71
-
Squad number13Player nameMüller
Average rating4.60
-
Squad number1Player nameNeuer
Average rating4.59
-
Squad number19Player nameSané
Average rating4.58
-
Squad number6Player nameKimmich
Average rating4.44
-
Squad number8Player nameGoretzka
Average rating4.30
-
Squad number3Player nameRaum
Average rating4.27
-
Squad number15Player nameSüle
Average rating4.13
-
Squad number11Player nameGötze
Average rating3.99
-
Squad number16Player nameKlostermann
Average rating3.87
-
Squad number4Player nameGinter
Average rating3.86
-
Squad number2Player nameRüdiger
Average rating3.81
Line-ups
Costa Rica
Formation 5-4-1
- 1Navas
- 4FullerSubstituted forBennetteat 74’minutes
- 6DuarteBooked at 76mins
- 19Waston
- 3Vargas
- 8OviedoSubstituted forContrerasat 90+3’minutes
- 12Campbell
- 5Borges
- 17TejedaSubstituted forWilsonat 90+3’minutes
- 20AguileraSubstituted forSalasat 45’minutes
- 11VenegasSubstituted forMatarritaat 74’minutes
Substitutes
- 2Chacón
- 7Contreras
- 9Bennette
- 10Ruiz
- 13Torres
- 14Salas
- 16MartÃnez
- 18Alvarado
- 21López
- 22Matarrita
- 23Sequeira
- 24Wilson
- 25Hernández
- 26Zamora
Germany
Formation 4-2-3-1
- 1Neuer
- 6Kimmich
- 15SüleSubstituted forGinterat 90+3’minutes
- 2Rüdiger
- 3RaumSubstituted forGötzeat 67’minutes
- 8GoretzkaSubstituted forKlostermannat 45’minutes
- 21GündoganSubstituted forFüllkrugat 55’minutes
- 19Sané
- 14Musiala
- 10Gnabry
- 13MüllerSubstituted forHavertzat 67’minutes
Substitutes
- 4Ginter
- 5Kehrer
- 7Havertz
- 9Füllkrug
- 11Götze
- 12Trapp
- 16Klostermann
- 17Brandt
- 18Hofmann
- 20Günter
- 22ter Stegen
- 23Schlotterbeck
- 24Adeyemi
- 25Bella-Kotchap
- 26Moukoko
- Referee:
- Stéphanie Frappart
- Attendance:
- 67,054
Live Text
-
Match ends, Costa Rica 2, Germany 4.
-
Second Half ends, Costa Rica 2, Germany 4.
-
Foul by Matthias Ginter (Germany).
-
Attempt saved. Jamal Musiala (Germany) left footed shot from the centre of the box is saved in the centre of the goal. Assisted by Serge Gnabry.
-
Joel Campbell (Costa Rica) wins a free kick in the defensive half.
-
Attempt blocked. Jamal Musiala (Germany) right footed shot from the centre of the box is blocked. Assisted by Joshua Kimmich.
-
Corner, Germany. Conceded by Youstin Salas.
-
Attempt missed. Niclas Füllkrug (Germany) header from the left side of the six yard box is just a bit too high. Assisted by Kai Havertz.
-
Attempt blocked. Niclas Füllkrug (Germany) right footed shot from outside the box is blocked. Assisted by Serge Gnabry.
-
Substitution, Germany. Matthias Ginter replaces Niklas Süle.
-
Substitution, Costa Rica. Roan Wilson replaces Yeltsin Tejeda.
-
Substitution, Costa Rica. Anthony Contreras replaces Bryan Oviedo.
-
VAR Decision: Goal Costa Rica 2-4 Germany (Niclas Füllkrug).
-
Goal! Costa Rica 2, Germany 4. Niclas Füllkrug (Germany) left footed shot from very close range to the bottom right corner. Assisted by Leroy Sané.Goal awarded following VAR Review.
-
Attempt saved. Mario Götze (Germany) header from the centre of the box is saved in the top centre of the goal.
-
Attempt saved. Kai Havertz (Germany) left footed shot from the left side of the box is saved in the centre of the goal. Assisted by Jamal Musiala.
-
Goal! Costa Rica 2, Germany 3. Kai Havertz (Germany) left footed shot from the centre of the box to the bottom right corner. Assisted by Serge Gnabry with a cross.
-
Attempt missed. Jamal Musiala (Germany) right footed shot from the centre of the box is too high.
-
Joshua Kimmich (Germany) wins a free kick in the defensive half.
-
Foul by Ronald Matarrita (Costa Rica).
Get the latest results and goal notifications for any team at the Fifa World Cup by downloading the BBC Sport app: Apple – Android – Amazon
Get your daily dose of Fifa World Cup reaction, debate & analysis with World Cup Daily on BBC Sounds