France drifted into the quarter-finals of Euro 2012 despite second-half goals from Zlatan Ibrahimovic and Sebastian Larsson providing a rousing Group D send-off for already-eliminated Sweden.
Laurent Blanc's men were second best throughout as they blew their big chance to emerge as group winners, and in the end had England to thank for beating Ukraine and keeping them in the competition.
Ibrahimovic struck a sensational volley to give the proud Swedes a 54th-minute lead then Larsson lashed home the second in injury time much to the delight of the Swedish fans in Kiev. France will now face reigning champions Spain in the last eight.
Erik Hamren's men, out after losing to both England and Ukraine, showed their intent from the start as they got forward well and fashioned their first chance with just three minutes on the clock.
Martin Olsson was allowed too much space on the left and floated a cross to Ola Toivonen, who outjumped the French defence but could only direct his free header over the bar.
Larsson also headed over from an Olsson cross while the Swedes missed a golden chance in the 10th minute when Toivonen sprung clear and rounded French keeper Hugo Lloris - only to then hit the post from a tight angle.
The French were struggling to make much of an impact, perhaps too secure in the knowledge that their last eight spot was virtually secure.
Franck Ribery fed Karim Benzema who blazed the best French chance over the bar but it was Sweden who continued to attack with more purpose, with Olsson in particular exploiting the space afforded him down the left.
The game drifted towards the interval in rather low-key fashion but France threatened in the final minute, Benzema playing in Ribery, whose shot from just inside the box was blazed high over the bar.
Sweden continued to look more likely to break the deadlock early in the second period, Larsson setting up Olof Mellberg who was ruled narrowly offside, with the French struggling to break down a resolute Swedish defence.
They almost did so in the 50th minute, when Benzema sprang the offside trap to race clear on the left flank, and after cutting inside onto his favoured right foot, unleashed a shot which flew just wide of Andreas Isaksson's left-hand post.
Alou Diarra brought a simple save out of Isaksson but just as France looked to be getting to grips with the game, the Swedes stole forward once again and claimed their richly deserved opener.
Toivonen saw a shot blocked by Lloris then moments later Larsson delivered a drifting ball in from the right which Ibrahimovic met with a spectacular volley to crash the Swedes ahead.
Mellberg drew a magnificent close-range save out of Lloris as Sweden came close to adding a second, but the French began to respond, with Samir Nasri drilling a shot wide and Yann M'Vila firing straight at Isaksson.
Nevertheless it was a strangely lethargic performance from the French, who seldom looked likely to wrest the tie - and with it the destiny of Group D - back to their advantage.
Substitute Jeremy Menez scuffed a simple chance straight at Isaksson with eight minutes to go, then moments later Oliver Giroud headed over the bar from close range when he should have scored.
Sweden made it two in injury time when Christian Wilhelmsson hammered Andreas Granqvist's cross against the bar and the ball rebounded for Larsson to ram home the simplest of chances.