Sweden and Germany were involved in another goal-fest to add to their previous 4-4 draw in World Cup qualifying, Joachim Low's side rounding off their Group C campaign with a 5-3 victory in Solna.
Pool runners-up Sweden opened up a 2-0 lead with goals from Tobias Hysen and Alexander Kacaniklic, but Mesut Ozil replied for Germany just before half-time.
Mario Gotze and Andre Schurrle turned the game around in the space of four second-half minutes before Schurrle added a fourth for the visitors. Hysen pulled a goal back again, but Schurrle completed his hat-trick to seal the German win.
Bastian Schweinsteiger, making his 100th appearance in a Germany shirt, had an early chance to crown his landmark appearance with a goal, but his effort missed the target.
Within 60 seconds, Sweden took the lead with their first attack, laying bare Germany's increasingly worrying defensive weaknesses having done so four times already last year.
Jerome Boateng was caught out of position by a pass into the path of Hysen, who slotted the ball through the legs of Manuel Neuer.
The hosts caught the Germany defence out again with Kacaniklic beating the offside trap and placing the ball under Neuer's left arm to make it two in the 42nd minute.
Sweden were on course to become the first nation since England in 2001 to beat Germany in a World Cup qualifier, but a goal just before the interval from Ozil, who benefitted from a fortunate deflection to place his shot in, reopened the game.
Ozil then set up half-time substitute Gotze, whose first touch was to despatch the ball into the top-right corner from the Arsenal midfielder's pass.
The turnaround was complete three minutes later when Schurrle pounced on a weak pass from Per Nilsson before being rewarded for his persistence as the ball spilled out to him from Nilsson's attempted recovery, and he tucked it into the far corner.
Schurrle's second gave Germany a two-goal advantage in the 66th minute with another cool finish after Mikael Antonsson lost possession inside his own penalty area.
Sweden reduced the arrears, making another 4-4 look ominously likely in the 69th minute when Hysen volleyed in his second at the near post.
An eighth goal did indeed arrive, although this time it was Germany grabbing a fifth with Schurrle completing his hat-trick in style, curling a shot into the top corner from the edge of the penalty area.
Hysen was denied a hat-trick of his own when his late effort was ruled out by an offside call from the referee's assistant.