Germany had gone 0-1 down in the first half, walking in at half-time in deep trouble, however a Marco Reus goal straight after the break gave them hope.
Throughout the game Sweden had been on the back front, but by the end Germany were throwing everything at them, despite going down to ten men late on.
The current world champions ended up playing with just two recognised defenders on the pitch, as they looked for a goal to give them their first win of the tournament.
It looked like Sweden would hold onto their point, with the clock ticking down to full-time and the scoreboard reading 1-1. However, Joachim Low's side won a free-kick in a very dangerous area in minute 95, and they were finally able to find the goal they were so desperate for.
Timo Werner was brought down just outside the box on the left by Jimmy Durmaz, who had come on as a substitute. Marco Reus and Toni Kroos lined up to to take the set play, and Kroos layed it off delicately for Reus, who fed it straight back to his teammate.
The Real Madrid midfielder seized the moment and curled a sublime finish past Robin Olsen at his far post, grabbing all three points for his team.