At least two people have been killed and several wounded in communal riot in the capital of the Central African Republic, a military source said.

The incident is the latest outbreak of violence in the lead-up to elections expected to be held in December.

The military source said on Saturday that several hundred people had fled the attacks in Bangui.

"Several houses were torched and heavy gunfire was heard in the Christian districts besieged by armed Muslims," he told the AFP news agency.

"Men, women and children were running in all directions."

Christian militiamen and army soldiers "took positions ... to protect the residents," the source said.

A diplomat said some of the UN and French forces who intervened were engaged sporadically by small groups.

Elections under threat

The violence erupted as Catherine Samba-Panza, CAR's transitional president, announced that a first round of legislative and presidential elections and a constitutional referendum would be held next month.

"There is already a consensus that these operations be held in December," she said.

She said while the latest upsurge in violence "perhaps does not jeopardise" the elections, it was "worrying".

Samba-Panza said the government was "counting on" UN peacekeepers and French soldiers, as well as the army, to "halt the current violence and especially to protect the people who feel a bit abandoned".

The National Authority for Elections' latest timetable proposes a constitutional referendum on December 6, to be followed by a first round of presidential and legislative elections on December 13.

If a second-round runoff is called for, it would take place on January 24.

The constitutional referendum was most recently set for October 4, while the other polls had been scheduled for October 18. All had already been postponed twice.

Samba-Panza said "the legal timeframe and the current situation" precluded completing the elections this year, adding: "We have to be realistic."

The fresh unrest came two days after four people were killed and around 20 wounded in Bangui in a reprisal attack avenging the deaths of two Muslims.

 Hundreds of thousands of people have fled CAR to neighbouring countries since the coup in early 2013 [AFP]

One of the poorest and most unstable countries in Africa, the landlocked former French colony plunged into chaos after Francois Bozize was deposed as president in a coup in March 2013.

The Muslim-led Seleka rebels behind the coup went on a rampage that led to the emergence of equally dangerous anti-Balaka (anti-machete) militias in mostly Christian communities.

Parliament appointed Samba-Panza the country's transitional leader in January 2014 until elections can be held.

Violence between members of the Christian and Muslim communities flared again in September, leaving scores dead and hundreds injured before an international force restored calm.

On Thursday, Samba-Penza's office announced that the defence and public security ministers had been sacked over their handling of the unrest.

Source: Agencies