UN peacekeepers and national security forces have retaken the Central African Republic's fourth-largest town a day after it was seized by rebels.
"The situation in Bambari is under control," said Abdoulaziz Fall, a spokesman for the 14,000-strong UN peackeeping mission Minusca on Wednesday.
"The civilians are starting to return. The armed groups have been pushed back into the bush," he added.
On Wednesday evening the French president, Emmanuel Macron, condemned the unrest less than a week before presidential and parliamentary elections.
Bambari, situated 380 kilometres north-east of the capital Bangui, was seized after a two-hour firefight with Minusca by members of the Unity for Peace in Central Africa militia.
Bambari's mayor said that civilians had not been attacked but the police station, gendarmerie and some homes had been ransacked.
But as Bambari was recaptured, tension continued to rise in Bangui on Wednesday. Businesses closed early and residents began to barricade themselves into their homes as fear of election violence took hold.
The government of President Faustin-Archange Touadera confirmed Rwanda and Russia had sent military aid to help restore calm.
The assaults on Bambari followed government claims last weekend that the former president, François Bozizé, was plotting a coup with armed groups ahead of Sunday's presidential and parliamentary elections.
Bozizé seized power in 2003 and ruled until he was was overthrown in 2013.
The 74-year-old former general returned to the country in December 2019 after years in exile, sparking fears of a comeback.
Bozizé retains a large following, especially among the Gbaya ethnic group, the country's largest, and in the army.
He was among several candidates barred from contesting the elections by the country's top court.
A number of rebel groups have formed an alliance and are threatening to march on the capital ahead of the vote which some opposition parties want postponed due to the latest violence.
Touadera, the frontrunner in the 17-strong field of presidential candidates, has rejected the call.
The United Nations, which has placed its troops in the capital and other regions on high alert, has also rejected a delay, fearing a power vacuum. It has promised to protect civilians and secure the vote.