France suffered their first defeat in 24 games as goals from Zlatan Ibrahimovic and Sebastian Larsson sealed a famous 2-0 win for Sweden in Euro 2012 Group D at the Olympic Stadium in Kiev.
Ibrahimovic produced a special strike to open the scoring early in the second half and Sunderland star Larsson added a second in stoppage time.
It meant Laurent Blanc's side ended Group D as runners-up and will meet world and European champions Spain at the Donbass Arena in Donetsk on Saturday evening.
England took over at the top of the standings with a 1-0 victory over Ukraine.
In a frantic opening, France were given an early scare as Ola Toivonen headed wide before skipper Hugo Lloris was called into action to stop Larsson's effort.
But Les Bleus hit back immediately at the other end as Franck Ribery's left-foot shot was parried at the near post by Andreas Isaksson.
Philippe Mexes then allowed Toivonen to break clean through, but the PSV Eindhoven striker went too wide of Lloris and could only hit the outside of the post.
Nine minutes into the second half Sweden opened the scoring thanks to a blockbuster of a strike from Zlatan Ibrahimovic.
Christian Wilhelmsson found Larsson in space down the right and his cross was met by the AC Milan striker just inside the area with an acrobatic right-foot volley, which flew into the bottom corner.
Yann Mvila tested Isaksson with a fizzing 30-yard effort as Laurent Blanc's side became increasingly frustrated.
Substitute Jeremy Menez then forced Isaksson into a good save and seconds later Olivier Giroud headed just wide from the resulting corner.
But the Swedes made the game safe when they broke forward in stoppage time and although Samuel Holmen's shot was tipped onto the bar, Larsson was on hand to slam the loose ball home and secure a well-deserved victory.
France midfielder Yann M'Vila has challenged his team-mates to show another side to their game after the defeat.
France - who last reached the knockout stages of a major finals in the 2006 World Cup - now play Spain and M'Vila has challenged his team-mates to prove their quality.
"We came upon a team that was far stronger than us," admitted M'Vila.
"We are going to play Spain, the world and defending champions.
"It is up to us to show another side to our game and to prove that we can go far in this competition."
Sweden skipper Ibrahimovic hailed the belief of his side.
He said: "The whole team played a great game. A lovely finish when you think of the two games we've had.
"We believed in it, we believed in each other, helped each other and communicated well."