The Central African Republic's Constitutional Court on Monday confirmed President Faustin Archange Touadera's victory in elections last month but said turnout, suppressed by armed groups, was little more than a third.
Chief Judge Daniele Darlan, validating results that gave Touadera 53.16 percent of the vote, said the 63-year-old "is proclaimed to be re-elected president."
The court put the turnout at just 35.25 percent, a figure affected by the inability of many voters to cast their ballots.
The runner-up was former prime minister Anicet Georges Dologuele, with 21.69 percent of the vote.
Touadera, a technocrat whose background is in mathematics, first took the helm in 2016 after a civil war that left thousands dead and drove hundreds of thousands from their homes.
Two-thirds of the impoverished country is in the hands of armed groups, and Touadera relies on help from UN peacekeeping forces and military support from Russia and Rwanda.
On December 19, a newly forged coalition of militias tried to advance on the capital Bangui -- an operation that Touadera said was an attempted coup fomented by his predecessor, Francois Bozize.
The court rejected a suit filed by 13 of the 16 other candidates, who argued that Touadera's victory was the result of "massive fraud" and insecurity.
The court annulled or revised the results from certain polling stations because of irregularities.
But it said that "given the size of the gap in votes", the impact "could not have affected" the overall outcome.
The court dismissed arguments that the vote lacked legitimacy.
"Part of the Central African people, who are at war, were prevented by acts of terror... and despite this, the people sent a strong and clear message to those who were terrorising them, to those who were telling them not to vote, and to the whole world," Darlan said, reading from a statement.
On Sunday, a coalition of CAR's main opposition political parties, COD 2020, accused the UN's representative, Mankeur Ndiaye, of favouring Touadera.
It said, without providing any evidence, that the Constitutional Court "reportedly was pressured" by Ndiaye to declare Touadera victor, and urged the UN to launch a probe.
"We have not received any pressure, either from the president, or from the special representative of the UN secretary general, or from any embassy," Darlan said.
"The court has worked in total independence."
The reaction in Bangui to Monday's announcement was muted.
A few cheers rang out in the court building and some cars sounded their horns outside, but the capital's streets were far quieter than usual, and many people said they feared rebel attacks.
Last Wednesday, the rebels mounted their closest attack yet to Bangui, striking a location on the city's outskirts before being pushed back with the loss of a peacekeeper.
They were thwarted by government and UN forces, as well as Russian paramilitaries and Rwandan troops who were rushed to Bangui under bilateral security pacts.
The UN said at the weekend that its troops had retaken control of Bangassou, a city 750 kilometres (470 miles) east of Bangui, that armed groups had seized two weeks earlier.
Around 60,000 people have fled the violence since December, the UN High Commissioner for Refugees said on Friday.
On January 13 alone, 10,000 people crossed the Ubangui River, a tributary of the Congo, to seek shelter in the Democratic Republic of Congo.