A Vincent Clerc try booked France's spot in the quarter-finals but it could not stop Tonga completing an upset 19-14 World Cup win.

Clerc's five-pointer in the dying seconds of the Saturday's match in Wellington earned France a bonus point for finishing within seven points of the victorious Tongans and was enough to ensure they qualified from pool A behind the All Blacks.

But it really was Tonga's day as they took the game to the French from the opening whistle.

Winger Sukanaivalu Hufanga dived over in the corner in the 26th minute as the Pacific Islanders took control of the match at Wellington Regional Stadium.

The margin of victory could have been even greater had Kurt Morath not missed four of his eight penalties and Samiu Vahafolau not squandered a certain try.

Both sides had a player sent to the sinbin for lifting tackles. Hufanga got his yellow card two minutes before the break, while Fabrice Estebanez sent off for ten minutes midway through the second half.

Dimitri Yachvili and Morath traded penalties to give France a 6-3 lead with a quarter of the match gone before Hufanga scored after a strong run from halfback Taniela Moa and a great cross-field kick from Morath, who added the conversion.

France had a golden opportunity in the 13th minute when Aurelien Rougerie got behind the Tongan defence but he threw a wayward pass which Samiu Vahafolau, on as a blood replacement for Finau Maka, gratefully gathered.

France thought they were back in front just five minutes later when hooker William Servat dotted down after a drive from the lineout but referee Steve Walsh called a double movement and Tonga survived.

Morath then kicked another penalty to stretch the Tongan's lead to 13-6.

Then in the 38th minute, Walsh, in consultation with his assistants Carlo Damasco and Dave Pearson, sent Hufanga to the sidelines.

The ragged French could not make the extra man count and wasted another chance when Servat and Jean-Baptiste Poux got in each other's way and the prop knocked on bringing an end to the first spell.

France continued to create and waste opportunities in the second half and had only a third Yachvili penalty to show for their efforts in the 20 minutes after the break as Tonga muscled up on defence and harried Les Bleus into mistakes.

But Morath's wayward kicking meant the French did not pay on the scoreboard.

Maxime Mermoz got on the outside of Siale Piutau in the 55th minute but then threw a pass to no-one, letting another French chance go begging.

Then in the 65th minute French replacement Estebanez lifted Joseph Tuineau in the tackle and was shown a yellow card and Morath slotted the resulting penalty to put Tonga 16-9 ahead.

Morath added another three-pointer with eight minutes to go before Clerc's last-ditch try took France into the last eight.