The Constitutional Court in Togo has confirmed Faure Gnassingbe as the winner of last month's disputed presidential election.
Thousands have fled Togo since the election
Mr Faure succeeds his late father, long-time president Gnassingbe Eyadema.
The court rejected an opposition appeal that the election had been rigged, saying it had "no substance".
The provisional declaration of Mr Faure's victory last week sparked days of riots but the capital, Lome, was reportedly calm overnight.
"The court proclaims Faure Gnassingbe elected president of the republic," said court chairman Atsou-Koffi Amegah.
Opposition leader Gilchrist Olympio told the BBC that he rejected the court's ruling and said his party would not join a transitional government, as urged by West African regional grouping Ecowas.
An Ecowas observer told the BBC on Wednesday that he saw "irregularities" during the polling.
Martin Assogba said that in one polling station in the northern stronghold of the winner, more ballots were cast than there were registered voters.
However, the official Ecowas delegation says the elections were broadly free and fair, despite a few isolated problems.
Mr Faure has denied the elections were rigged
Thousands of people have fled Togo for neighbouring Benin and Ghana as a result of the political violence since the election.
At least 22 people died in unrest, mostly in opposition areas of Lome.
Mr Faure's inauguration could be as soon as Wednesday.
He was initially sworn in as leader in February, following his father's death but strong pressure from Ecowas led him to step down and contest elections.