Match ends, Germany 1, Sweden 2.
Two-time champions Germany suffered a shock Women's World Cup quarter-final exit as Sweden came from behind to beat them 2-1 in Rennes.
Germany had gone ahead through Lina Magull's acrobatic finish but Sweden responded when Sofia Jakobsson ran clear on goal and coolly finished.
Stina Blackstenius poked in from close range early in the second half and they managed to hold on to their lead.
Sweden's semi-final opponents are the Netherlands, who defeated Italy 2-0.
Sweden and the Netherlands join Great Britain - who benefit from England's run to the last four - in qualifying for the 2020 Olympic Games in Tokyo as the top three European teams at the World Cup.
Germany will not get the chance to defend the gold medal they won at Rio 2016.
'German ghost' laid to rest
With their pedigree in the women's game, Martina Voss-Tecklenberg's Germany side were heavy favourites to progress having triumphed in the tournament in 2003 and 2007, as well as claiming eight European Championship titles.
Chelsea's Swedish defender Magdalena Eriksson had spoken before the game about being "tired of hearing about this German ghost", having not beaten their opponents in a major tournament since 1995 and losing to them in four major finals, including the 2003 showpiece.
There looked to be more disappointment on the cards for the Swedes as goalkeeper Hedvig Lindahl had to keep out Lina Magull's free-kick and Lea Schuller's header early on.
Magull then got on the scoresheet when she controlled and brilliantly converted the opener from Sara Dabritz's pass, but Sweden turned the game around thereafter.
Germany had not conceded a single goal in this tournament but that changed when former Chelsea forward Jakobsson latched on to a long ball and equalised, before Blackstenius scored from close range after German goalkeeper Almuth Schultz parried Fridolina Rolfo's header.
The expected German onslaught failed to materialise and their best chance of taking the game to extra time fell to teenager Lena Oberdorf with two minutes remaining, but she headed wide of an empty net after Lindahl missed the cross.
Analysis - 'A big surprise'
England midfielder Jordan Nobbs on BBC One: "This is the beauty about football, everyone thought Germany had a route to the final but Sweden have got everything right today. They counter-attacked really well, were clinical in front of goal and their defence was one of the best in the tournament so far. Playing against Germany was tough but they showed why they are into the next round.
"It is a big surprise. Not many people have been talking about this side of the draw because it was all about France, the USA and England. Everyone thought Germany would cruise to the final."
Former England defender Claire Rafferty: "I cannot say I am too upset that Germany are going home. Sweden got the tactical gameplan spot on. When Alexandra Popp and Dzsenifer Marozsan went up top for Germany late on, we were expecting balls up front and to play to their strengths.
"Right to the very end, Sweden were causing issues. Sofia Jakobsson was fantastic. Every time she picked the ball up she looked dangerous. Their full-backs stopped Germany's who usually like to get forward."
Super Swedes - the stats
- Germany have been knocked out of the Women's World Cup at the quarter-final stage for the third time in eight appearances.
- It is 20 years since a side lost a quarter-final after leading. That was Germany too - a 3-2 defeat against the USA in 1999.
- Sweden are the first side to come from behind and progress in the knockout stage of the current World Cup.
- Germany conceded in the opening half for the first time in their past 22 World Cup matches. Sweden had scored the previous one through Hanna Ljungberg in the 2003 final.
- Sweden have scored in all 14 of their World Cup knockout matches (22 goals).
- Stina Blackstenius became the first Sweden player since Lena Videkull in 1991 to score in consecutive World Cup knockout appearances.
- 2SimonSubstituted forMaierat 43'minutes
- 16DallmannSubstituted forMarozsánat 45'minutes
- 7SchüllerSubstituted forOberdorfat 70'minutes
- 5FischerSubstituted forIlestedtat 66'minutes
- 23RubenssonSubstituted forBjornat 86'minutes
- 18RolföBooked at 56minsSubstituted forHurtigat 90+5'minutes
- 16Zigiotti Olme
- Stéphanie Frappart
- Shots on Target
Second Half ends, Germany 1, Sweden 2.
Foul by Lena Oberdorf (Germany).
Magdalena Eriksson (Sweden) wins a free kick in the defensive half.
Substitution, Sweden. Lina Hurtig replaces Fridolina Rolfö.
Attempt missed. Marina Hegering (Germany) header from very close range is too high. Assisted by Svenja Huth.
Attempt blocked. Svenja Huth (Germany) right footed shot from outside the box is blocked. Assisted by Alexandra Popp.
Attempt saved. Sara Däbritz (Germany) left footed shot from the left side of the box is saved in the centre of the goal. Assisted by Lena Oberdorf.
Attempt missed. Stina Blackstenius (Sweden) right footed shot from outside the box is just a bit too high. Assisted by Fridolina Rolfö.
Attempt missed. Lena Oberdorf (Germany) header from the centre of the box is close, but misses to the left. Assisted by Dzsenifer Marozsán with a cross following a set piece situation.
Lena Oberdorf (Germany) wins a free kick on the right wing.
Foul by Magdalena Eriksson (Sweden).
Foul by Alexandra Popp (Germany).
Caroline Seger (Sweden) wins a free kick in the defensive half.
Substitution, Sweden. Nathalie Bjorn replaces Elin Rubensson.
Alexandra Popp (Germany) wins a free kick in the attacking half.
Foul by Amanda Ilestedt (Sweden).
Delay over. They are ready to continue.
Delay in match because of an injury Alexandra Popp (Germany).
Offside, Germany. Dzsenifer Marozsán tries a through ball, but Alexandra Popp is caught offside.