Rival vigilante militias in the Central African Republic have clashed with heavy weapons overnight in the capital Bangui, residents say.

The gunfire had subsided by Saturday noon, but the situation remained tense in a northern suburb of Bangui, where the fighting took place.

"It is the anti-balaka, they do not leave us alone," one resident fleeing the clashes in the Boy-Rabe neighbourhood told AFP, referring to the mainly Christian vigilante groups.

The "anti-balaka" (anti-machete) forces were formed following the overthrow of president Francois Bozize by the mainly Muslim Seleka rebel coalition in March 2013.

The Seleka carried out a campaign of violence against the majority Christian community in the aftermath of the takeover, prompting the creation of the vigilante militia.

"Since last night, they have engaged in targeted attacks. Locals do not dare to leave. Some residents were injured in the crossfire while trying to flee," the resident said.

An officer with an African Union peacekeeping force said its soldiers had been deployed to the entrances of the troubled suburb.

"There is a tense situation brewing in the neighbourhood of Boy-Rabe," the officer told AFP on condition of anonymity.

The officer said two people had been killed in what appeared to be a "settling of scores."

Shattered calm

A traditional stronghold of the anti-balaka militia, Boy-Rabe has for months been the scene of numerous clashes between the Christian militia and the Seleka coalition, which held power from March 2013 until January this year, when a power-sharing agreement was signed.

Saturday's violence shattered a sense of calm that had reigned in the capital for a number of weeks, following more than a year of brutal violence, rights abuses and looting.

Shortly after the fighting ended, thousands of people braved the rain in Bangui to take part in a peace march.

Addressing the crowd, transitional President Catherine Samba-Panza said a new government would be formed "in the coming days".

"Even if some people want to persist with atrocities, God will confound them," she said.

Representatives of the Seleka rebel coalition and anti-balaka forces signed a tentative ceasefire in July aimed at ending violence in the country.

Despite the peace accord, tensions remain high in the country, where several Seleka militiamen were killed on Tuesday in a clash with French peacekeepers in the north.