Two ex-prime ministers in the Central African Republic will contest a run-off after no candidate gained 50% in the first round of presidential elections, officials have said.
Anicet Georges Dologuele, who came first with 24%, will face Faustin Touadera, who got 19%, on 31 January.
Last week, more than a million people took part in the first presidential election since a coup in March 2013.
The country has since been wracked by conflict along religious lines.
Twenty of the 30 candidates vying to replace interim leader Catherine Samba-Panza had earlier this week complained of irregularities and called for the count to be halted.
But many of them were persuaded by the transitional government to withdraw their complaints, and the constitutional court will have to look into the remaining grievances.
Top four candidates:
- Anicet Georges Dologuele 23.8% - 281,420 votes
- Faustin Touadera 19.4% - 229,564 votes
- Desire Kolingba 12.6% - 149,134 votes
- Martin Ziguele - 10.8% - 121,009 votes
1,181,115 votes were cast and there was a 79% turnout
Source: CAR electoral commission
Mr Dologuele was prime minister between 1999 and 2001, and has also served as the country's finance minister.
Mr Touadera was prime minister in the government of ex-President Francois Bozize, who was overthrown in 2013.
CAR has been torn by sectarian violence since the Seleka rebels seized power in March 2013.
A band of mostly Christian militias, called the anti-Balaka, then took up arms against the Seleka.
The interim government and international donors pushed for the poll, believing that an elected president and parliament would help CAR recover from years of unrest.
CAR is one of the world's poorest countries - yet it is rich in natural resources.
Elections also took place for the 149-seat National Assembly.
After seizing power, the Seleka rebels installed Michel Djotodia as the first Muslim leader of the majority Christian country.
But under pressure from regional leaders and former colonial power France, Mr Djotodia stood down and was succeeded by Ms Samba-Panza.
About 1.8 million people were registered to vote, out of a population of roughly five million.
More than one million people fled their homes during the communal fighting.