Despite Germany taking a hefty lead with Mertesacker and Ozil adding goals to a double from Klose, Sweden completed a magnificent comeback with a stoppage-time equalizer.
Miroslav Klose got the hosts off to a brilliant start as he netted two early goals, putting him two strikes away from equalling Gerd Muller's record of 68 goals for Germany. Per Mertesacker added another before the break, and soon after the restart Mesut Ozil gave Joachim Low's side a comfortable lead.
The Swedes responded impressively in the second half, with Erik Hamren's halftime substitutions having a great effect, as they had a hand in all the goals. Strikes from Zlatan Ibrahimovic, Mikael Lustig and Johan Elmander set up a tense finish, and the visitors completed an astounding comeback in stoppage time through Rasmus Elm.
Sweden began its ascent in 62nd minute as Ibrahimovic beat the offside trap to steer a header past Manuel Neuer from Kim Kallstrom's ball forward. Seemingly galvanized by that goal, another ball over the top, again courtesy of Kallstrom, created another chance for the visitors. Lustig controlled it well, and with his second touch powered a shot at Neuer that somehow squirmed into the goal.
Tthe Swedes then came to within one goal of the hosts, stunning the Berlin crowd in the process. In space on the left, Alexander Kacanikilic picked out Elmander who beat Holger Badstuber to the ball and poked it in at the far post.
Tobias Sana blazed over in front of an open goal in the 85th minute, but unperturbed, Sweden found the eqaulizer at the death. A cross from the left was not dealt with by Mertesacker and his loose header fell to Elm who volleyed in to complete the remarkable comeback.
The first half could not have contrasted more starkly, as following their 6-1 thumping of Republic of Ireland, the Germans got straight into their stride. Less than two minutes had been played when Andreas Isaksson stopped Thomas Muller and the follow-up effort crashed off the post.
The Germans took the lead in the eighth minute, though. Philipp Lahm played Marco Reus in at the byline and his cutback was smashed into the top corner by Klose to finish a brilliant move. Things only got better for the hosts as Klose added his second in the 15th minute following some intricate one-touch play. Reus initiated the move, scything his way into the box with two successive one-twos before pulling the ball back to the 34-year-old, who fired home at the second time of asking.
After stepping off the gas midway through the half, Low's men soon reasserted themselves, and following Isaksson's save to keep Reus out, they got their third in the 39th minute. A cross from the left was kept in play at the back post by Muller, whose looped header was rifled past the keeper by an unmarked Mertesacker.
Germany did not let up after the break, and after Muller was once more denied by Isaksson, he delivered a cross that found Ozil at the back post. The Real Madrid man controlled the ball on his chest before angling a shot into the far corner.
The result means Germany has surrendered its perfect record in Group C but remains three points clear of second-placed Sweden.