A voter casts her ballot at a polling station in Antananarivo, Madagascar, Wednesday, Nov. 7, 2018. On November 28, the country's top court announced that the two former presidents Andry Rajoelina and Marc Ravalomanana will face each other in a run-off election next month. File picture: Kabir Dhanji/ AP Photo.

Antananarivo - Two former presidents of Madagascar, Andry Rajoelina and Marc Ravalomanana, will face each other in a run-off election next month to decide who will lead the Indian Ocean island nation, the country's top court announced Wednesday.

The run-off comes after neither candidate won the 50% of votes required for a first-round victory on November 7.

Rajoelina got 39.23% of votes and Ravalomanana 35.35%, according to final results released by the Constitutional Court.

"The two candidates cleared to go to the second round are Andry Rajoelina and Marc Ravalomanana," Constitutional Court judge president Jean Eric Rakotoarisoa said.

The run-off vote will take place on December 19.

It is the first time the bitter rivals are facing each other at the ballot box.

Both Ravalomanana, 68, and Rajoelina, 44, were banned from running in the last election in 2013 under international pressure to avoid a repeat of deadly political violence that engulfed the island in 2009.

Ravalomanana ruled from 2002 to 2009 until he was ousted in a military-backed coup that installed Rajoelina, who was in power until 2014.

Rajoelina's succcessor and the country's immediate past president Hery Rajaonarimampianina was eliminated from the race after he came a distant third with just 8.82% of the ballots cast. The court shot down his application to annul the results.

Judge Rakotoarisoa cautioned the two hopefuls to "avoid provocations" as they headed into the final stretch of the election in a country which has history of political turmoil. 

"The people of Madagascar do not need trouble," he said.

Extra military patrols were seen on the streets of the capital Antananarivo.

- Rivals go head-to-head -

Rajoelina, who sat in court on Wednesday, had lodged complaints with the court alleging election officials tampered with software to "inflate" the number of registered voters in the first round in what he labelled "vote manipulation".

He had also accused Ravalomanana of vote buying. 

The electoral commission rejected the allegations and the court threw out his petition.

Last week Ravalomanana withdrew his legal complaints over alleged irregularities in the first round, with his lawyer saying the decision was reached for the sake of "peace and sovereignty of Madagascar".

Madagascar, a former French colony, is well known for its vanilla and precious redwood, yet is one of the world's poorest countries, according to World Bank data, with almost four in five people living in grinding poverty.

In the largely peaceful campaign to the first round of election, the frontrunners spent huge sums on flashy campaign rallies and helicopters. A total of 36 candidates took part.

Shortly after the court session on Wednesday, Rajeolina vowed to appeal to voters whose intentions were up for grabs.

"I open my arms, let's work together to save Madagascar. I will do my best to convince the undecided," he told reporters.

Ravalomanana's campaign team called those who shunned the ballot box on November 7 "to come and do their duty" in the second round. Turnout in the first round was 54%.