Despite a victory over Costa Rica, Germany was knocked out of the World Cup.
Germany needed three points to have a chance of reaching the last 16 after Japan beat Spain.
The four-time champion finished third in the group and were eliminated on goal difference.
Germany were in complete control and in front, only for Costa Rica to turn the match on its head and raise the possibility of Spain also leaving the tournament.
Yeltsin Tejeda tied the game with a goal in the 58th minute after Germany's keeper pushed out a goal attempt.
Costa Rica and Japan were going through with each other.
It would have capped one of the most amazing nights in World Cup history but Germany substitute Kai Havertz restored a measure of normality to proceedings with two clinical finishes to extinguish Costa Rica's hopes of springing a major shock.
It will be pointless as Germany failed to reach the knockout stage of the tournament for the second time in a row.
This was the first men's World Cup game in which an all-female ref team took charge, with France's Frappart refereeing, along with assistants from Brazil and Mexico.
Germany's second successive exit at the group stage will be a shock to their system, but they can have no complaints.
After losing to Japan in their opener, they showed real character to come from behind to draw with Spain, but the first game defeat left them vulnerable.
The first half hour of a Germany win looked like it was going to be easy as they dominated with ease.
Costa Rica looked like they were going to qualify after Germany's nonchalant attitude gave them an entry into the game, but it wasn't long before they were knocked out.
This World Cup could be the end for the older generation such as goalkeeper Neuer and forward Thomas Muller.
There is a good chance of a lengthy inquest into the failure at the finals.
There's more to come.
Get the latest results and goal notifications for any team at the Fifa World Cup by downloading the BBC Sport app: Apple - Android - Amazon
You can get a daily dose of the World Cup on the radio.