It was one of those nights that France could well live to regret. Needing to match England's result in Donetsk to be sure of finishing top of the group and avoid a quarter-final with Spain, Laurent Blanc's side suffered their first defeat by Sweden in 43 years on an evening when nothing went right for Les Bleus.

The French coach warned his players beforehand about the perils of underestimating Sweden but his advice went unheeded on an evening when the damage to their hopes of progressing beyond the last eight of this competition was considerable.

Blanc, a picture of frustration on the touchline in the second half, will have to make do without his leading central defender against the defending champions in Donetsk on Saturday after Philippe Mexès was ruled out through suspension after picking up his second yellow card of the tournament.

Sweden were ahead at that point and there was much to admire about the glorious goal that gave them the lead. Zlatan Ibrahimovic, who is entitled to feel aggrieved that the rest of Euro 2012 will take place without him after playing so well in all three of Sweden's group matches, executed a spectacular bicycle-kick that flashed beyond Hugo Lloris, the one France player to emerge from this game with any credit.

It was a wonderful piece of skill that showcased Ibrahimovic's sublime talent and allowed Sweden to take control of the game en route to picking up their first points in Group D. There was a period early in the second half when Sweden laid siege to the France goal and, although Blanc's side rallied late on, when the substitutes Jérémy Ménez and Olivier Giroud had decent chances to equalise, Sebastian Larsson punished them for a second time, in the closing seconds, to inflict a first defeat in 24 matches.

France could have no complaints about the result. They looked a shadow of the team that attacked with such menace against Ukraine and there was an element of desperation about their play at times as they resorted to shooting from distance against a Sweden side that had conceded five goals in their previous two matches.

"We were prepared for a very tough game," Blanc said. "Did we think it was going to be as difficult as it was? No, we didn't expect that. We were too weak in certain areas. We weren't strong enough in the tackle. Sweden played with a lot of heart and physically are a lot better than us. And in their ranks they have a player [Ibrahimovic] who can make the difference in a game."

France have not played against Spain in a competitive match since the 2006 World Cup, when they won 3-1 to reach the quarter-finals. Much, however, has changed since then and Blanc made it clear that there would need to be a huge improvement if France were going to have any chance of causing an upset. "You always have to be optimistic," he said. "Of course we're disappointed with the result. But the most important thing is we qualified for the quarter-finals. I congratulate Sweden because they were excellent but they're going home.

"It's not the easiest thing to play Spain. We're also going to have one day less rest. We'll have to put in a really good performance to beat Spain and it's very difficult to imagine [beating them after] how we played tonight. But we'll focus and hopefully on Saturday we'll find a better level.

"The problem with Spain is they don't let you have the ball very much. We can expect a Spanish side who want to keep the ball as they always want to do. But we have to try to counter that. I think Croatia have shown what you need to do against Spain. Every time they had a chance they really went for it. And I think that's what we're going to need to do."

Spain will be rubbing their hands on the evidence of France's woeful display here. Sweden were rampant for a spell after the interval and were close to a breakthrough in the 53rd minute, when Lloris repelled Larsson's close-range volley. The reprieve was short-lived. Some 28 seconds later, the France goalkeeper was retrieving the ball out of the back of the net after Ibrahimovic splendidly swept home Larsson's cross from about 15 yards.

Christian Wilhelmsson, who caught the eye as a second-half substitute, came close to making it 2-0 moments later only to be denied by Lloris. France were reeling at this point and Lloris made another fine stop to turn over the bar Olof Mellberg's clever flick, which had shades of Danny Welbeck's goal against Sweden last Friday.

With England leading against Ukraine, Blanc went for broke and introduced Ménez and Giroud in the final 15 minutes to try to turn the game around.

France nearly hauled themselves level but Andreas Isaksson did just enough to keep out Ménez's scuffed shot and Giroud, with his first touch of the ball, inexplicably headed Florent Malouda's corner wide.

Larsson, thrashing into the unguarded net after the substitute Samuel Holmen had hit the woodwork, was nothing like as generous, his sixth international goal giving Sweden's superb travelling supporters a result to cherish. "They should have played like that from the start," Blanc said, "because I think if they had played like that in all three games they would have qualified."