Tonga produced the upset of the rugby World Cup when they beat France 19-14 on Saturday but some poor decision making cost the Pacific Islanders at least five tries as a nervy French side took the bonus point they needed to advance to the last eight.
Flyhalf Kurth Morath slotted four penalties and converted Sukanaivalu Hufanga's try for Tonga, who had needed a four-try victory to give them any chance of qualifying for the quarterfinals.
Winger Vincent Clerc scored an injury-time try to rescue a bonus point, for losing by fewer than eight points, as scrumhalf Dimitri Yachvili slotted three penalties for a dismal France side who were outplayed in the second half.
New Zealand top Pool A on 15 points with one match to play, while France will finish second on 11 points after completing their four fixtures and face the winners of Pool B in the quarterfinals. Tonga ended their campaign on 9 points.
"Congratulations to Tonga team but we are disappointed with what we did today. They played with heart but today we... I can't say anything about what we did today. Too many mistakes," France captain Thierry Dusautoir said in a pitchside interview.
"If we play like this next week, we don't have any chance of making the semifinals. We must take lessons from this."
France had the better of the opening exchanges, though their scoring was restricted to a Yachvili penalty, which was quickly negated when Morath slotted the first of his four successful kicks.
The score ignited the Pacific islanders, who began to find gaps in the French defensive line, particularly running directly at centres Maxime Mermoz and Aurelien Rougerie, who appeared to be hampered by a leg injury sustained earlier in the game.
Yachvili managed to give the French a 6-3 lead in the 23rd minute with his second penalty before Tonga stormed ahead after Hufanga gathered Morath's cross-kick and shrugged off Julien Bonnaire's tackle for the game's first try.
Morath converted the score then added a 36th minute penalty for Tonga, who had Hufanga sinbinned by referee Steve Walsh for a dangerous tackle on Clerc.
Tonga held the French out to reach halftime with a 13-6 lead that they could have extended less than three minutes into the second period though Morath missed the penatly.
Yachvili reduced the deficit to 13-9 with his third penalty of the match, although the French never really threatened again until the last two minutes.
The match was effectively over as a contest when France replacement Fabrice Estebanez was sinbinned for a dangerous tackle on Joe Tu'ineau and Morath added his third penalty.
Morath added a fourth penalty after Tonga had squandered a golden opportunity to score a late try and Clerc rounded off the scoring with an unconverted try in the corner after a series of scrum penalties.
France - Try: Vincent Clerc. Penalties: Dimitri Yachvilli (3).
Tonga - Try: Sukanaivalu Hufanga. Conversion: Kurt Morath. Penalties: Morath (4).