UN peacekeeping troops said they have retaken control of a city in the Central African Republic captured two weeks ago by armed groups waging an offensive against the government of President Faustin Archange Touadera.

Rebels abandoned their positions in Bangassou, 750 kilometres (470 miles) east of the capital Bangui, and fled the city following an ultimatum on Friday from the UN peacekeeping force MINUSCA, the mission's spokesman Vladimir Monteiro said late Saturday.

"The city of Bangassou is under the complete control of MINUSCA," Monteiro said, though he added that the UN force "remains on alert" to prevent any rebel return or other actions against civilians, the state authority and UN troops.

Armed groups waging a nationwide offensive captured the city on January 3, forcing many residents to flee across the border to the Democratic Republic of Congo.

"It's a great joy," Juan Jose Aguirre, the bishop of Bangassou, told AFP, following the UN operation to regain control of the city.

"After 13 days sleeping outdoors, people will be able to return to their homes," he added.

Lieutenant Colonel Abdoulaziz Fall, spokesman for MINUSCA's military component, said the UN force intervened to stop attempts at looting overnight Friday to Saturday.

"The situation is calm and under control and positions that had been occupied by armed groups are no longer," Fall said.

"The looting of the city of Bangassou by the rebels... before their retreat on the arrival of the reinforcements made up of elements of the Rwandan contingent of MINUSCA, shows up one of the aims of these foreign mercenaries: loot our riches and the property of our people," Prime Minister Firmin Ngrebada said in a Facebook post.

Six of the most powerful armed groups, who have occupied roughly two-thirds of the country for eight years, united a month ago to wage an offensive.

The coalition announced their offensive ahead of the December 27 presidential and legislative vote, aimed at preventing Touadera's re-election.

Armed groups waging a nationwide offensive captured Bangassou on January 3. A UN patrol is seen passing the city's cathedral in 2017.
Armed groups waging a nationwide offensive captured Bangassou on January 3. A UN patrol is seen passing the city's cathedral in 2017. AFP / ALEXIS HUGUET

On January 4, Touadera was declared the victor, although the political opposition cried foul.

On Sunday, an opposition alliance called on the UN to investigate its special envoy to the country, Mankeur Ndiaye, accusing him of "conspicuously" backing Touadera during the polling.

MINUSCA spokesman Monteiro said on Twitter late Sunday that Ndiaye "remains focussed on his mission... with the total and unreserved support of the international community."

The election results accounted for only about half of registered voters, as hundreds of thousands were unable to cast their vote in areas held by rebels.

On Wednesday, the rebel forces mounted their closest attack yet to Bangui before being pushed back with the loss of a peacekeeper, the UN said.

The UN refugee agency UNHCR said on Friday that the number of people fleeing violence following the presidential election had doubled in a week to 60,000.

More than 50,000 of those had fled across the Ubangui River to the Democratic Republic of Congo -- with 10,000 people arriving in the DRC on Wednesday alone as rebels attacked near Bangui.

Landlocked CAR is one of the world's poorest nations and has seen a string of coups and wars since it gained independence from France in 1960.

In 2013, it spiralled once more into bloodshed when then-president Francois Bozize, who had himself seized power in a coup a decade earlier, was ousted by a mainly Muslim coalition called the Seleka.

MINUSCA has almost 12,000 military personnel. The peacekeeping mission, first deployed in 2014, has been extended until November 2021.