Ali Bongo, the son of Gabon's long-time leader Omar Bongo, has won an election to succeed his late father, the interior minister has announced.
Officials said on Thursday Bongo had won the election with 41.73 per cent of the vote.
Just over 800,000 voters registered to take part in Sunday's election, which was called after Omar Bongo's death in June, ending nearly 42 years of tight rule over the central African oil nation.
"[Ben Bongo] is elected," Jean-Francois Ndongou, the interior minister declared on state television on Thursday.
Andre Mba Obame, a former interior minister, and Pierre Mamboundou, an opposition leader, were nearly tied, receiving 25.8 and 25.2 per cent of the vote respectively.
Opposition supporters in Gabon's second city set fire to France's consulate general after Ali Bongo was declared the winner of the election, witnesses said.
Security forces had earlier used tear gas earlier to disperse hundreds of opposition supporters who had led an overnight sit-in on a square near the election commission in the capital Libreville.
A witness said the streets of Libreville were empty on Thursday apart from a heavy security presence.
Al Jazeera’s Mohamed Adow, reporting from Libreville, said that "Police seem to have the situation under control ... [they] have been dealing with the protesters heavy handedly.
"Obamer and Mamboundou said the elections were fraudulent right from the beginning.
"They say they will not accept the results and have called upon their supporters once again not to support the election results."
Ali Bongo's rivals had said they feared the official results were being massaged to ensure a dynastic succession from father to son, an accusation Bongo, the former defence minister, has denied.
Observers and financial markets have played down the risk of major instability in the tiny country, but some unrest was expected given the dispute over the result.
The death of 73-year-old Omar Bongo ended a period that brought his country stability.
Gabon hosts oil firms including France's Total and US-based Vaalco, and is one of the few sub-Saharan countries to have launched a Eurobond.
Analysts say Ali Bongo now faces the challenge of diversifying the economy to replace revenue from Gabon's dwindling oil reserves.