UN troops patrolled Bangui to stop a repeat of the clashes during a recent referendum on a new constitution.
Thirty candidates vied to replace interim leader Catherine Samba-Panza.
CAR has been torn by sectarian violence since a largely Muslim Seleka rebel group seized power in March 2013.
A band of mostly Christian militias, called the anti-Balaka, then took up arms against the Seleka.
In January 2014, a transitional government was formed but elections have been postponed four times since February 2015 due to insecurity and logistical challenges.
‘We want to be free’
Three candidates are considered frontrunners for the presidency.
Two of them – Martin Ziguele and Anicet Dologuele – were prime ministers under late President Ange-Felix Patasse. The third, Karim Meckassoua, is a Muslim who served as a minister under President Francois Bozize until he was ousted in 2013 by Seleka rebels.
UN peacekeepers staged patrols and positioned armoured personnel carriers at polling stations in Bangui.
“I’ve been dreaming of this election for two years since the day armed men killed my father and my brother in Bangui. I voted for peace,” said Ahmat Abouna, who fled to the Cameroon border town of Garoua-Boulai and voted along with thousands of other refugees, Reuters news agency reports.
Businessman Gradias Vara said: “We came to vote because we want to be free to get back to our professions. We want to put an end to the conflict.”
Voting was extended at numerous polling stations where logistical problems had delayed voting, including in Bangui’s flashpoint PK5 district, the AFP news agency reports.
The new head of the 11,000-strong UN force, General Bala Keita, said the atmosphere was “good-natured”, and there had only been a few “administrative issues”.
“It won’t be like last time [the referendum vote]. We have learned, the people have learned, the saboteurs have learned. So we have all have learned. So today, God willing, all will go well,” he told journalists in Bangui.