Voting began in presidential and legislative elections in the Central African Republic on Sunday, in a key test for one of the world's most troubled nations.

The polls take place after a week of turbulence, marked by accusations of an attempted coup, the brief seizure of the CAR's fourth-largest town and the dispatch of military personnel by Russia and Rwanda to help its beleaguered government.

U.N. peacekeepers and local and Rwandan soldiers were patrolling the streets throughout the capital, with armored vehicles posted outside voting places armed with machine guns, AFP journalists saw.

There was a delay of around 50 minutes before some polling stations in Bangui opened as voting materials had not been delivered on time.

"It's very important for me to be here, as a citizen. I think this vote will change our country, whoever the president will be," teacher Hortense Reine said.

Senior officials at the election authority told AFP that where polling stations had opened late, voting would continue for an additional 50 minutes.

Away from Bangui sporadic fighting has been going on for nine days, and scattered incidents were reported by mid-morning on Sunday.

In the northwest, more than 500 kilometers (300 miles) from the capital, rebels seized election materials in Koui and election officials received death threats in Ngaoundaye, according to a senior UN official.

In some areas, rebels threatened anyone who went to vote.

Meanwhile thousands of people had not received their voter cards due to insecurity, according to local and UN officials who all requested anonymity.

Ousted former president Francois Bozize, who was barred from standing and has been accused by the government of plotting a coup, urged people not to vote and backed a rebel coalition.

"I call on you, my countrymen, not to vote. Stay at home. Let Touadera place his ballot in the box alone," Bozize said in an audio message published online which his party confirmed to AFP.

Questions over legitimacy

The frontrunner for the presidency is incumbent Faustin Archange Touadera, who was elected in 2016.

The mineral-rich but poverty-stricken country has been chronically unstable since independence 60 years ago.

Thousands of people have died since a civil war erupted in 2013 and more than a quarter of the population of 4.9 million have fled their homes. Of these, 675,000 are refugees in neighboring countries and cannot vote.

Even though bloodshed has receded in intensity over the last two years, violence remains chronic. Militia groups hold sway over two-thirds of the territory, spurring fears about intimidation that could also affect turnout.

Experts and opposition figures have already asked what legitimacy the president and 140 MPs to be elected will have, given the obstacles to a large proportion of people outside Bangui voting freely.

On December 19, the government accused armed groups of banding together and advancing on the capital in a plot allegedly fomented by Bozize, a charge he denies.

Fears about the rebels swept the city in the following days, although the UN peacekeeping force MINUSCA said their advance had been stopped.

'How do we vote?'

Some voters said sporadic fighting was potentially undermining the vote.

"Everyone is fleeing at the moment. I'm holed up at home," Robert, from Boali, 80 kilometres (50 miles) north of Bangui told AFP by phone, explosions audible in the background.

"How do we vote when we don't even have our voter cards," he added.

The rebel coalition on Wednesday announced a 72-hour "unilateral cease-fire" in the runup to the vote, only to call it off on Friday.

In a statement authenticated by two of its six members, the coalition said that it would resume its march on the capital.

On Tuesday, the CAR's fourth-largest town, Bambari, 380 km northeast of Bangui, was overrun but security forces backed by U.N. peacekeepers regained control the following day.

On Sunday, polling stations in Bambari remained closed in the morning because of gunfire from armed groups, according to Jeannot Nguernendji, president of the local peace committee.

Sixteen candidates are vying for the presidency.

Touadera's main rival is Anicet Georges Dologuele, an economist and former prime minister.

He is being backed by Bozize after his own bid was barred by the CAR's top court for being on a 2014 wanted list and under UN sanctions.

A runoff vote will be held on February 14 if there is no overall majority in the first round.

Around 1,500 candidates are contesting the 140 seats in the national assembly, but many have been unable to campaign because of insecurity.