Madagascar's feuding leaders said yesterday they had agreed a power-sharing deal and would hold elections on the Indian Ocean island within 15 months.

A communique issued after talks in Mozambique's capital said a national unity government would be set up and comprise a prime minister, three deputy prime ministers and 28 ministers.

"They agreed the transition period will not exceed 15 months ... and will end with elections under international supervision that will lead to the restoration of democratic institutions and stability in Madagascar," the statement said.

Former President Marc Ravalomanana, who was toppled in March by his army-backed rival Andry Rajoelina, said he would return to Madagascar but not personally take part in the process.

The agreement included cancelling charges of abuse of office that were levelled against Ravalomanana after his departure and related to the purchase of a presidential jet.

"I solemnly declare my total availability to help resolve this crisis," he said after days of talks mediated by former Mozambican president Joaquim Chissano. "The Ravalomanana movement will be an integral part of the transition bodies."

The deal was struck late on Saturday and the negotiations ended on Sunday with several details unresolved.

"There has not yet been any discussion about the allocation of seats. We had to adjourn because the age of some former heads of state did not allow more meetings," Rajoelina told reporters.

The talks, which began on Wednesday and also included former presidents Didier Ratsiraka, 73, and Albert Zafy, 82, were the first time Ravalomanana and Rajoelina had met face to face since the coup.

The political crisis has alarmed foreign investors, scared away tourists and cut economic growth. Rajoelina has been shunned by many nations and Ravalomanana, living in exile in South Africa, had insisted he remained the legitimate leader.

Lydie Boka, Madagascar expert at the risk consultancy StrategieCo, said the power-sharing deal looked to be a major breakthrough in restoring ties with the international community.

"It will allow donors who wish to help Madagascar to safely resume their assistance without being accused of supporting an illegal government," she told Reuters.

"There are several risks, however, in that the new government, which will attempt to assemble four different 'sensibilities', may lead to a paralysis of the country."

Ratsiraka and Zafy, the former presidents, are still seen as influential Malagasy power brokers and analysts say they would need to be part of any lasting solution.

Before the Maputo talks, Rajoelina had said a presidential election would be held by the end of 2010, but could take place earlier under the right conditions. The timing of the poll and who will be able to contest it have been big sticking points.

Opposition groups had insisted that Rajoelina, who has scrapped the constitution and set up an interim government, must not be allowed to plan an election unilaterally.

Rajoelina suspended the island's parliament in March, a move that opponents said was unconstitutional. It was not immediately clear how the agreement would affect this suspension.