Nine candidates and one citizen had lodged complaints with the court
Gabon's Constitutional Court has upheld Ali Ben Bongo's victory in August's presidential election, opening the way for him to be sworn in.
Nine opposition candidates had called for the vote to be annulled, arguing that there was widespread fraud.
They accused Mr Bongo - the son of the country's former ruler, Omar Bongo, who died in June after 41 years in power - of rigging the re-count.
There was violence in several cities after the result was first announced.
The Constitutional Court's decision was read out on state television on Monday evening by the chief justice, Marie-Madeleine Mborantsuo.
August's election was called after the death of Ali Ben Bongo's father
"The election of Mr Ali Bongo Ondimba as president of the Gabonese republic is confirmed," the judge said.
According to the court, which controversially ruled that opposition representatives could not observe the re-count last month, Mr Ben Bongo won the election with 41.79% of the vote.
The opposition politician, Pierre Mamboundou, came second with 25.64%, followed by the former interior minister, Andre Mba Obame, on 25.33%.
Mr Mba Obame, who began a hunger strike in protest at the result of the recount, lost the runner-up spot after his share of the vote fell by 0.55%.
Gabon is sub-Saharan Africa's fourth biggest oil producer and Africa's second biggest wood exporter, although most of its 1.4 million people live in poverty.
August's election was called after the death of Omar Bongo, one of the world's richest men, who had ruled the nation for four decades.