Chelsea’s Andre Schuerrle claimed a second-half hat trick as Germany emerged victorious.
Germany had already qualified for Brazil 2014 as Group C winners while Sweden as runners-up now face a two-legged play-off next month.
But there was far more than just pride at stake at Stockholm’s Friends Arena with Germany smarting from their 4-4 draw in Berlin last October after throwing away a 4-0 lead.
Having last lost either a European Championships or World Cup qualifier back in October 2007, Germany were heading for a rare defeat until scoring four second-half goals.
“It’s annoying to concede three goals, but we have once again shown what power we have when we are going forward,” beamed man-of-the-match Schuerrle clutching the match ball.
“That would make it hard for any team in the world.”
Joachim Loew’s Germany extended their unbeaten run to 32 qualification matches, but captain Philipp Lahm was not impressed.
“We have a bit of work to do, not only in defence, but also in attack,” said the Bayern Munich star.
Even without suspended superstar Zlatan Ibrahimovic, Sweden raced into the lead with goals by Tobias Hysen and Alexander Kacaniklic before Arsenal’s Mesut Özil pulled one back just before the break.
The Germans then ran riot in the second-half with Bayern Munich’s Mario Goetze coming on to equalize before Schuerrle hat-trick, while Hysen pulled one back for the Swedes.
Sweden capitalized on some poor German defending after just six minutes when a great pass from Sunderland’s Sebastian Larsson found Hysen in space and he fired past Germany goalkeeper Manuel Neuer.
The Germans poured forward to try and get back on level terms, but Sweden doubled their lead with half-time beckoning.
Fulham’s Alexander Kacaniklic sprinted onto Kim Källström’s through ball and fired home despite the attention of Germany defender Mats Hummels with 42 minutes gone.
Both goals could be blamed on Germany’s back four, but the origins came when the ball was first lost in midfield.
Arsenal’s Özil celebrated his 25th birthday by pulling a crucial goal back for Germany when he rifled home his shot from the edge of the area on the stroke of halftime.
Germany coach Loew brought on Goetze for the second-half for right-winger Thomas Mueller and the Bayern Munich star immediately made a difference.
Schuerrle fed Ozil after some good work on the left wing, then the Arsenal star squared for Goetze to loop his shot around Sweden goalkeeper Johan Wiland on 53 minutes to equalize.
Germany took the lead for the first time when Schuerrle pounced on a poor pass from Sweden defender Per Nilsson and although the Nuremberg man scrambled back, he lost his footing allowing the Chelsea star to fire home on 57 minutes.
Goetze set up Schuerrle to fire home on 66 minutes to make it 4-2 to the Germans, but Sweden dug deep as Hysson claimed his second goal as he beat the offside trap to volley home Larsson’s free-kick on 69 minutes.
There was to be no denying Schuerrle, who claimed his first hat-trick for Germany by hitting the top right-hand corner of the goal 11 minutes from time to dismiss any ideas of a Sweden fight back.
It means Germany finish their World Cup qualifying campaign undefeated with nine wins from ten games and an eight-point lead over Sweden at the top of Group C.