Mozambicans voted on Tuesday in an election widely expected to result in the ruling Frelimo party extending its decades-long rule over a country that is set to become one of the world's main gas exporters.

The election in the southern African nation could test a fragile peace deal signed two months ago between Frelimo and rival Renamo, a former civil war foe that has emerged as the main opposition party.

Most of Mozambique's 13 million registered voters were born after Frelimo came to power in 1975, when the country won independence from Portuguese colonial rule.

A corruption scandal over government borrowing has hit the economy and damaged President Filipe Nyusi's popularity, but the strength of some voters' loyalty to Frelimo is one factor that could help the party win the presidential, legislative and provincial polls.

A low-level insurgency in the north, on the doorstep of billion-dollar gas projects being developed by oil majors including Exxon and Total, has also taken the shine off Nyusi's presidency and threatens security longer term.

Polls opened at 7 a.m. (0500 GMT) and were due to close at 6 p.m. (1600 GMT), with the law allowing 15 days for results to be announced - though they could come sooner.

Even if Nyusi wins, as expected, Renamo wants to win local elections in its traditional strongholds, giving it control over provinces for the first time since the civil war ended in a truce in 1992.

Renamo fought Frelimo for 16 years from 1977 to 1992 in a Cold War conflict that killed about one million people. It ended in a truce but sporadic violence has flared in the years since - including after Renamo challenged election results in 2014.

Under the peace deal signed in August this year, provincial governors will now be picked by the main party in each province, rather than the government in Maputo - an opportunity for Renamo to gain long-thwarted representation.

But factionalism in Renamo and the fading popularity of its leader, Ossufo Momade, could yet make winning the number of provinces it would like a tall order.

Should it come back empty handed, that could jeopardise the peace deal.

The run-up to the vote has already been marked by sporadic violence, including the killing of an election observer and attacks from a breakaway group of Renamo fighters. The risk is the violence could worsen if the result is disappointing for the party.

A crowd that welcomed Nyusi at his final campaign rally in Maputo on Saturday cheered when he promised peace would last.

‘Without peace, can we build factories ... can we build roads?’ Nyusi asked, to cries of ‘No’ from supporters decked in his party's signature red.