The Central African Republic's fourth-largest town, which was seized by rebels Tuesday ahead of elections this weekend, is back in the hands of United Nations peacekeepers and national security forces, the UN said.

The rebel attacks followed government accusations at the weekend that ex-president Francois Bozize was plotting a coup with armed groups ahead of presidential and legislative elections next Sunday.

"The situation in Bambari is under control," Abdoulaziz Fall, spokesman for the UN's peacekeeping force in the CAR, told a press conference in the capital Bangui on Wednesday.

"The civilians are starting to return. The armed groups have been pushed back into the bush."

Portuguese peacekeeping troops headed out on Tuesday towards Boali, a town on the key RN1 highway where rebels had clashed with security forces Portuguese peacekeeping troops headed out on Tuesday towards Boali, a town on the key RN1 highway where rebels had clashed with security forces Photo: AFP / ALEXIS HUGUET

At the CAR's request, Russia and Rwanda have sent "hundreds" of military personnel to support the troubled country, the government says, an account confirmed by those countries.

Bambari is located 380 kilometres (240 miles) northeast of Bangui.

Members of a militia called Unity for Peace in Central Africa (UPC) overran the town on Tuesday after a two-hour firefight with the UN peacekeeping force MINUSCA, sources said.

Its mayor said on Tuesday that civilians had not been attacked, but the police station, gendarmerie and some homes had been ransacked.

Frontrunner: President Faustin-Archange Touadera Frontrunner: President Faustin-Archange Touadera Photo: AFP / Ludovic MARIN

The UN's Human Rights Office warned on Wednesday it was "deeply alarmed" by reports of escalating violence, which it said posed a grave threat to lives and the elections.

The CAR is one of the poorest and most unstable countries in the world, experiencing only rare moments of peace since it became independent from France in 1960.

Map of the Central African Republic locating Bambari Map of the Central African Republic locating Bambari Photo: AFP / Maryam EL HAMOUCHI

On Saturday, the government said three armed groups had formed an alliance and were advancing on highways to Bangui in a plot fomented by Bozize. MINUSCA said late Sunday that the advance had been halted or rolled back.

But on Tuesday armed groups attacked the road arteries, notably at Boali, a town 60 kilometres (37 miles) from the capital, prompting an exodus by women and children, sources there said.

Several pickup trucks arrived in Bangui later, laden with wounded, AFP reporters saw.

"There was some panic among the public (in Bangui) this morning," General Driss Oukaddour, commander of MINUSCA'S Bangui Joint Task Force, told AFP on Wednesday.

Bozize's return sparked fears that he planned to stage a violent comeback Bozize's return sparked fears that he planned to stage a violent comeback Photo: AFP / FLORENT VERGNES

But, he insisted, "Bangui is calm, we are in charge of the situation."

Food supplies to the capital depend on the RN1 highway linking the city to Cameroon, and security on the road swiftly affects prices of staples such as manioc.

Bozize, who denies the government's allegations, came to power in a coup in 2003 before he himself was overthrown in 2013, in a conflict that largely mirrored the CAR's sectarian divisions.

The 74-year-old former general slipped back into the country in December 2019 after years in exile, sparking fears of a comeback.

He retains a large following, especially among the Gbaya ethnic group, the country's largest, and has many supporters in the army.

Bozize has been barred from contesting Sunday's elections by the CAR's top court as he is the target of a 2014 arrest warrant for alleged murder and torture and is under UN sanctions.

His absence has left incumbent Faustin-Archange Touadera, 63, as clear frontrunner in the 17-strong field of presidential candidates.

But Touadera's government remains weak and the armed forces are poorly-equipped and -trained and remain heavily dependent on MINUSCA.

Despite a peace deal between the government and armed groups in February 2019, the country remains wracked by violence.

Militias hold sway over two-thirds of the territory, deriving income from mining and forced payments at roadblocks and on traders.

Thousands of people have died in the last seven years, and nearly a quarter of the population of 4.7 million have fled their homes.

Genevieve, a shop worker in Bangui, said, "I am worried for our country because rebels are coming, we're afraid for our children."

A security guard who gave his name as Mathias, said the situation was hopeless.

"There's nothing here -- it's only bandits who get by!" he said angrily.

"What I am going to tell my children? I can't even pay for their education. What are they going to do, do bank robberies or steal? To be frank, brother, I just want to leave this country."