Zlatan Ibrahimovic's spectacular second-half volley helped Sweden to a Euro 2012 consolation victory over France on Tuesday, condeming the French to second place in Group D and a quarterfinal against Spain.
The AC Milan forward struck flat and hard from the edge of the box on 54 minutes to give his team their first win after two narrow defeats.
England win Group D after beating Ukraine 1-0 in Tuesday's other game in Donetsk to set up a quarterfinal with Italy.
The defeat, France's first in a 23-match run stretching back to September 2010, means they face the reigning champions Spain, who finished top of Group C.
Little separated the sides until Sweden coach Erik Hamren introduced midfielder Christian Wilhelmsson at half time. The player gave Sweden another attacking option, used to devastating effect midway through the second half as the Swedes conjured their best football of a disappointing competition.
Martin Olsson crossed for Ola Toivonen, in for the injured Johan Elmander, to loop a header just past Hugo Lloris' goal inside three minutes.
Larsson headed straight at the French No. 1 moments later.
The French found space down the left to release Hatem Ben Arfa, but the Newcastle man fired wide.
The ball fell to Franck Ribery when tthe Swedes failed to clear, the Bayern Munich winger sending a left-footed drive straight at Andreas Isaksson.
Sweden should have gone ahead on ten minutes when Toivonen outjumped Philippe Mexes and rounded Lloris only to hit the post from an acute angle.
Ribery and lone striker Karim Benzema combined on 18 minutes for the Real Madrid forward to half-volley over.
Sweden reproduced that move moments later with Jonas Olsson the one to miss.
Ben Arfa found space 25 yards from goal and swerved a wicked left-footer just over the bar.
The teams sparred in midfield, canceling each other out until three minutes before half time, when Benzema let fly from 25 yards with a shot that bounced just wide.
Ribery then stumbled through a few challenges to hit a shot that Olof Mellberg lunged to take the sting out of, the last meaningful action of the half.
France shot out of the blocks in the second half as Benzema beat the offside trap from a Nasri through pass and tried to steer the ball around Lloris, but he put it around the post too.
Alou Diarra, yet to score for France in 44 games, sent a long-range effort straight at Isaksson.
Sweden then grabbed the game by the scruff of the neck, playing their most decisive football of the tournament.
Lloris was force into a reflex save on 53 minutes with
It was a warning France failed to heed, falling behind in the next attack.
Sweden worked it out to Larsson on the right, whose targeted cross found Ibrahimovic lurking on the edge of the box. The AC Milan forward twisted in the air, connecting sweetly to lash the ball into the goal.
Ibrahimovic turned provider moments later, playing in substitute Christian Wilhelmssson, who half-volleyed against Lloris' chest.
Mellberg flicked the resulting corner at goal, but Lloris got a last-second fingertip to the ball to divert it just over.
France coach Laurent Blanc looked to seize back the initiative by replacing Ben Arfa with Florent Malouda.
It had an immediate impact as Nasri hit a left-foot drive inches wide on the hour, with Ribery having one blocked a couple of minutes later.
France midfielder Yann M'Vila shot from out right on 71 minutes, but Isaksson pawed away at his near post.
Benzema turned on the edge of the box to thump marginally past the right upright.
A flurry of substitutions changed the pattern of the game as Blanc went in search of the equalizer.
It almost had an immediate effect with Jeremy Menez, who scored against Ukraine, jinked through the Swedish defense to drag a shot just side.
Another substitute, Olivier Giroud, nearly scored with his first touch seconds later, rising to head a corner just wide on 83 minutes.
But it was Sweden who had the last say, with Larsson volleying in after Samuel Holmen's shot came back off the crossbar.
Sweden: Andreas Isaksson, Olof Mellberg, Andreas Granqvist, Martin Olsson, Sebastian Larsson, Anders Svensson (Samuel Holmen, 78), Kim Kallstrom, Zlatan Ibrahimovic, Jonas Olsson, Emir Bajrami (Christian Wilhelmsson, 46), Ola Toivonen (Pontus Wernbloom, 78).
France: Hugo Lloris, Mathieu Debuchy, Adil Rami, Philippe Mexes, Franck Ribery, Karim Benzema, Samir Nasri (Jeremy Menez, 77), Yann M'Vila (Olivier Giroud, 83), Alou Diarra, Hatem Ben Arfa (Florent Malouda, 59), Gael Clichy.