Kroos found the net with a wickedly curling set-piece in the 95th minute of a game that brought out the best and worst of Joachim Low's world champions, who were reduced to 10 men when Jerome Boateng was sent off with eight minutes remaining.
It capped a dramatic turnaround in a match that Germany could not lose after Die Mannschaft were defeated in its opening Group F game to Mexico, but such a scenario was on the cards when Ola Toivonen's superb lob gave Sweden a lead they held until half-time.
But Low's team-talk at the break obviously struck a chord with the world champion, which levelled early in the second half through Marco Reus' scrappy effort.
Boateng's dismissal threatened to unravel their efforts to get back into the match and it looked as though they would have to settle for a point that would have left their hopes of progressing from the group hanging in the balance, but, with the clock winding down, Kroos' stunner sparked jubilant German celebrations and simultaneously broke Swedish hearts.
The result leaves Group F wide open with no team yet mathematically through. Mexico leads the way on six points, while Germany and Sweden are on three, and South Korea still on zero.