Madagascar's constitutional court has confirmed the victory of incumbent President Marc Ravalomanana in the 3 December election.
Marc Ravalomanana was re-elected with a substantial majority
Mr Ravalomanana gained 54.8% of the vote in the first round of the poll, securing a second five-year term.
His rivals had lodged complaints with the court about the vote but election observers said the poll was fair.
Mr Ravalomanana, a former dairy magnate, said he felt "optimistic" about the island nation's future.
"I am very happy," Mr Ravalomanana told Agence France Presse.
"This confirms our confidence with Madagascans and the international community."
The court took an additional two weeks to confirm the result due to the time taken to collect the ballot boxes from the furthest regions of the island, some 1,600km (1,000 miles) long.
Mr Ravalomanana is expected to be formally sworn in within the first half of January.
In 2001, the island nation was pushed to the brink of civil war after the then-incumbent Didier Ratsiraka refused to accept defeat.
Roland Ratsiraka, nephew of the former president, gained 10.14% of the vote, coming third after former parliamentary speaker Jean Lahiniriko, who gained 11.65%.
In mid-December authorities said they had arrested an army general wanted over a coup attempt last month.
The officer, known as General Fidy, took control of a military base in November and called on the army to remove President Marc Ravalomanana.