Sweden striker Lotta Schelin put her side ahead in the first half only for French replacement Elodie Thomis to equalise on 56 minutes before Swedish striker Josefine Öqvist was sent off on 68 minutes.
But in the dramatic closing stages, substitute midfielder Marie Hammarström won the game -- and the bronze medal -- for Sweden with a superb strike in the 82nd minute.
"I wasn't thinking of my friends in Lyon, just my friends in Sweden," said striker Schelin, who plays for Olympique Lyon in France.
"I am so happy about what we have achieved. It is a good team and we work for each other.
"We refocused after missing the opportunity to play in the final and at least we have a medal now."
Both teams had already secured the two available European places at the 2012 Olympic Games in London by reaching the semi-finals.
"It ends with two losses, but the team played with great heart," said France coach Bruno Bini.
"We tried to get back in the game, but sometimes things don't go your way. At least we have qualified for the Olympics."
Sweden's 3-1 defeat to Japan in Frankfurt on Wednesday and France's 3-1 loss to the USA in Moenchengladbach the same day brought the teams to the play-off.
The Swedes took the lead when a pass by defender Sara Larsson from inside her own half found Schelin and the Lyon striker chipped her shot past French goalkeeper Berangere Sapowicz on 29 minutes.
To add injury to insult, Sapowicz was stretchered off in obvious pain as the replay showed her jumping to block Schelin, only to land on her right ankle, which buckled underneath her.
France fought back straight after the double blow and Paris Saint Germain midfielder Elise Bussaglia hit the post straight after with Sweden goalkeeper Hedvig Lindahl well beaten.
The French got back on level terms when left winger Gaetane Thiney won a tussle for the ball on the edge of the penalty area and strung a pass through the defence for substitute Elodie Thomis to roll her shot past Lindahl on 56 minutes.
Sweden were reduced to 10 players when Öqvist was shown a red card for lashing out.
"She kicked me, and I kicked back. I shouldn't have done what I did, but I think the referee was a coward. Both of us should have been sent off," Öqvist said to Swedish national TV station TV4.
Despite the loss of a player, the Swedes continued to dig deep for the winning goal.
From a corner, the ball was headed away to Marie Hammarström -- who had only come off the bench an hour into the game - and the 29-year-old produced a stunning goal.
Having controlled the ball with her chest, she unleashed a fierce drive from the edge of the area which gave French substitute goalkeeper Celine Deville no chance.
"I couldn't understand. I don't even know what I did, I don't know," said an elated Hammarström to TV4.
"I didn't even think I would be in the World Cup. This is the best thing I've ever experienced."