Germany's late, late show keeps Joachim Loew's on course to be the first team to retain the title in 56 years but their fate is still not entirely in their own hands.
The defending champions were in desperate trouble when Ola Toivonen lifted the ball over Manuel Neuer to put the Swedes ahead in the first half in Sochi after Kroos gave the ball away.
Germany, looking far sharper than they did in their opening defeat against Mexico, piled forward and eventually earned their reward when Marco Reus reacted quickly to turn the ball in shortly after the interval.
Despite incessant pressure, Loew's men could not find the goal they craved as time ticked away and Germany's task was made more difficult when key defender Jerome Boateng was sent off in the 82nd minute for a second yellow card.
But Kroos had other ideas, stepping up in the 95th minute to curl a free-kick from the left edge of the penalty area into the top corner, beating the despairing dive of Robin Olsen, who had been outstanding in the Swedish goal.
"We never lost hope. I think there was a bit of luck there with the goal scored in stoppage time, but it was a result of our belief in ourselves," said Loew. "Despite the adversity, the team kept their cool and turned it around."
Germany -- level with Sweden on three points, with Mexico on six points -- must now beat South Korea in Kazan on Wednesday and hope the other result in Group F goes their way.
- Mexico win -
Mexico showed that their shock defeat of Germany last weekend was no fluke with a 2-1 defeat of South Korea in Rostov-on-Don.
West Ham striker Javier Hernandez grabbed his 50th international goal while Los Angeles FC forward Carlos Vela was also on target from the penalty spot.
South Korea scored a late consolation strike from Tottenham's Son Heung-min, but it was too little, too late for the Asian giants, who desperately needed a victory after losing to Sweden in their opening game.
"Sometimes against teams that have less of a footballing tradition than the biggest nations, you can tend to rest on your laurels and lose concentration," said Mexico coach Juan Carlos Osorio.
"But it was a deserved victory. We are very happy and we share that with the whole of the country."
- Lukaku, Hazard strike -
In the first game of the day, Belgium produced an imperious display to overwhelm Tunisia, with Premier League stars Romelu Lukaku and Eden Hazard scoring two apiece in a 5-2 rout at Moscow's Spartak Stadium.
The one-sided victory cemented Belgium's place at the top of Group G and all but guaranteed their place in the knockout rounds, with just one group game, against England, remaining.
Manchester United striker Lukaku took his goals tally to the tournament to four as the Red Devils carved open Tunisia's defence with an impressive attacking display.
Dylan Bronn and captain Wahbi Khazri grabbed consolation goals for Tunisia, who now face almost certain elimination.
Belgium and England will qualify for the last 16 on Sunday if England defeat Panama in Nizhny Novgorod.
As the fallout from Friday's politically charged clash between Switzerland and Serbia rumbled, FIFA opened disciplinary proceedings against Swiss players Granit Xhaka and Xherdan Shaqiri over their pro-Kosovo goal celebrations.
FIFA is also probing Serbian national team Mladen Krstajic for alleged statements made after the game.
Both Xhaka and Shaqiri, who have roots in Kosovo, a former province of Serbia that has declared independence in a move not recognised by Belgrade, celebrated their goals in the 2-1 win by making a gesture representing the Albanian flag.
Disciplinary proceedings have also been opened against the Serbian FA for crowd disturbances and the display of political and offensive messages by Serbian fans, world football's governing body said in a statement.
Krstajic demanded German match referee Felix Brych be tried as a war criminal in The Hague after failing to award his team a penalty.
"I wouldn't give him either a yellow or red card, I would send him to The Hague," he said. "Then they could put him on trial, like they did to us."
The now-defunct Hague-based International Criminal Tribunal for the former Yugoslavia was a UN body that prosecutes the perpetrators of war crimes committed during the wars in the former Yugoslavia.
Follow the World Cup with The Phuket News
Keep up to date with all the FIFA World Cup results and group standings by following The Phuket News by clicking here.
You can also get a free printable copy of The Phuket News World Cup wallchart via the link.
Best of luck for your home nation!