Antananarivo, Nov 8 (AFP) Election officials began counting ballots in Madagascar after Wednesday's vote for a new president in which three former heads of state ran as the Indian Ocean island seeks to defuse a political crisis.

Attempts by the most recent president Hery Rajaonarimampianina to change the island's electoral laws backfired, sparking nearly three months of sometimes violent protests in the capital Antananarivo.

The demonstrators forced Rajaonarimampianina to accept a "consensus" government tasked with organising an election in this impoverished nation with a history of coups and unrest.

Nearly 10 million voters were eligible to cast ballots for one of 36 candidates who also included two ex-prime ministers, several pastors and a rock star.

To win, a candidate must get 50 per cent of the votes cast or a second round will be held on December 19. Only about 44.5 per cent of voters turned out, according to the electoral commission.

Provisional results, expected by November 20, must be confirmed by the High Constitutional Court by November 28.

"I want a president who gets me out of poverty," said Eline Faraniaina, a retired 60-year-old, as she cast her ballot at a vocational college.

Two of the candidates, both former presidents, said Wednesday they were confident of victory.

"I am optimistic and positive, I do not think there will be a second round," dairy tycoon Marc Ravalomanana said at his political headquarters, where dozens of supporters gathered.

For his part, former nightclub promoter Andry Rajoelina spoke to hundreds of supporters gathered at the studio of his TV chain Viva, saying he was satisfied the early results "express the desire for change."

Ravalomanana ruled from 2002 to 2009, followed by Rajoelina who was in power until 2013, and then Rajaonarimampianina until earlier this year. The trio staged massive rallies over the weekend in the capital, each attracting tens of thousands of supporters.

The former French colony has struggled to overcome political divisions after a disputed 2001 election that sparked clashes and a 2009 military-backed coup that ousted Ravalomanana.

Apart from protests earlier this year, Rajaonarimampianina's term was mostly peaceful but anger over the past still simmers.

If re-elected, he has promised "a new phase" in Madagascar's development.

"Frankly it's difficult to live like that. There are days when I can't feed my children," said Tantely Randriandrina, a washerwoman who earns less than $1 a day.

The key battle will be between Rajaonarimampianina and the former presidents Ravalomanana and Rajoelina, according to analysts and the findings of a banned pre-vote poll seen by AFP.

"The big risk of this election is that it will return us to an era of crisis," said Sahondra Rabenarivo, an analyst at the Malagasy Observatory on Public Life.

"It's very important that the results are credible and that the third-placed candidate accepts them." Rajaonarimampianina called it "a big day... a victory for democracy" after casting his ballot.

Ravalomanana has a tense relationship with Rajoelina, who succeeded him with the backing of the army in the 2009 uprising.

Madagascar is one of the world's poorest countries, according to World Bank data, with almost four in five people living in grinding poverty.

The main contenders -- armed with significant campaign resources -- have crisscrossed the island of 25 million by helicopter promising voters a better future.

"They should revive the country. Madagascar suffers malnutrition and is ravaged by cyclones," said retiree Lili Rahaingo, 68, as she queued to vote in the capital.

Although two people died in bloody protests in April, campaigning has been peaceful and the vote passed off without incident, the interior ministry said.

Some candidates have been accused of vote-buying, with the local head of Transparency International Ketakandriana Rafitoson saying she was "disgusted" by the offer of T-shirts, sewing machines and even floor tiles to secure votes.

Around 20 lower-profile candidates have alleged irregularities in the electoral roll and had unsuccessfully called for the poll to be delayed.

Both Ravalomanana and Rajoelina were banned from contesting the last elections in 2013. (AFP) NSD

(This is an unedited and auto-generated story from Syndicated News feed, LatestLY Staff may not have modified or edited the content body)