The defending champions came unstuck late on in Kazan, losing 2-0 thanks to a pair of stoppage-time goals as they were caught out chasing a victory they desperately needed.
Korea matched Germany's physicality as strong challenges punctuated the first 10 minutes and they nearly took the lead when Manuel Neuer spilled Jung Woo-young's swerving 25-yard free-kick, but the Bayern Munich goalkeeper managed to punch the ball out for a corner before anyone could pounce on the rebound.
Both Brazil goals came in added time and Neymar wept after netting their second, but was earlier accused of diving after the video assistant referee overturned a penalty awarded to him when replays showed there was minimal contact.
After defeats against Sweden and Mexico, nobody gave the Taeguk Warriors a chance but they absorbed sustained German pressure and Kim Young-gwon and Son Heung-min scored goals right at the end to give the team a famous win and ensure that Germany, the world number one, finish Group F in fourth, one place below Korea.
A long punt upfield saw Tottenham forward Son chase a clearance to fire into an empty net.
L'Allemagne arrache la victoire face à la Suède (vidéo) — Coupe du Monde
Dans des propos repris par l'Équipe , Joachim Low n'a pas caché son soulagement. " Ca m'a vraiment agacé et mis en colère ". Les Suédois n'ont pas apprécié et quelques bousculades ont suivi.
This is the third time in succession that the defending champions have been eliminated in the group stages. The disappointment of us being eliminated is just huge. Mesut Ozil was returned to the lineup along with Sami Khedira and a fit-again Mats Hummels, while Niklas Sule and Leon Goretzka made their first starts of the tournament in a 4-3-3.
Germany vs South Korea: When is today's World Cup match? Although it's likely that Germany will have more possession, we will do our best.
Victory will confirm Brazil as group winners, but coach Tite is warning that under-fire superstar Neymar can not be expected to win the World Cup on his own and is not yet at full fitness.
Sweden defeated Mexico in their Group F match. More than £430,000 was matched on the Germans at [1.17].
Germany limped to a goalless conclusion of the first half but with Mexico vs. Sweden also a stalemate, it did not matter as Low's men were through by virtue of their head-to-head record against the Swedes - a 2-1 win last Saturday courtesy of Toni Kroos' 95th minute victor.
He also stopped substitute Mario Gomez's second-half header. Mexico, having beaten Germany and South Korea, will take on the victor of Group E in the next round. Germany, one of the pre-tournament favorites, was out. A lot of things we built up since 2006, always at least (a) semi-final.