Also in Group C, Ireland rallied to beat Kazakhstan 3-1 and Austria defeated the Faeroe Islands 3-0.
Germany finished with 28 points and could have had a perfect record had it not squandered a four-goal lead to draw Sweden 4-4 last year in Berlin.
Sweden took second place with 20 points, three more than Austria, while Ireland was fourth with 14. Kazakhstan had five points and the Faeroe Islands finished last with a single point.
Germany coach Joachim Loew said the qualifying campaign had exposed some cracks in the defense despite the near-perfect record.
"In some matches that part hasn't been perfect," he said. "But overall we're satisfied."
Hysen gave Sweden the lead in the sixth minute after Germany defender Jerome Boateng allowed the striker to slip into the penalty area unchallenged and meet a long pass from Sebastian Larsson.
Germany took full control after the early setback but struggled to create chances beyond Thomas Mueller's header into the crossbar. Instead the German defense was caught napping again as Kim Kallstrom fed the ball to Kacaniklic, who made it 2-0 in the 42nd.
Oezil put the visitors back in the game just before the break as he caught a deflected pass from Max Kruse and struck a right-foot shot just inside Sweden goalkeeper Johan Wiland's right post.
Sweden, without suspended striker Zlatan Ibrahimovic, had very little possession and was lucky to be ahead at half time.
Second-half substitute Mario Goetze equalized shortly after the break with an elegant shot and Schuerrle silenced the home crowd with two goals preceded by mistakes in the Swedish defense. But Hysen revived Sweden's hopes when he made it 4-3 with a volley on a free-kick from Larsson.
It took another goal from Schuerrle to seal the win for Germany as he completed his hat-trick in the 77th with a beautifully curled shot from the left edge of the penalty area.
"We just have to admit we lost to a better team," Sweden coach Erik Hamren said.
In Dublin, Dmitri Shomko put Kazakhstan ahead before Ireland rallied with first-half goals from Robbie Keane and John O'Shea and an own goal by Andrey Finonchenko in the second.
Austria finished its qualifying campaign with goals from Andreas Ivanschitz, Sebastian Proedl and penalty kick from David Alaba.