Madagascar's rival leaders ended their months-long impasse with an agreement to form a unity government, in a deal that sees Andry Rajoelina remain interim president, but cede power to a consensus prime minister, officials said Sunday, according to dpa. The Maputo Political Accord follows four days of internationally mediated talks on the political crisis in the Indian Ocean island, held in the Mozambican capital. The interim administration will govern Madagascar until general and presidential elections, to be held in under 15 months time. The political race "will conclude with internationally supervised, credible elections leading to the restoration of democratic and stable institutions in Madagascar," United Nations special envoy Tiebile Drame said. While he is not named in the accord, Rajoelina will remain interim president, chief mediator, former Mozambique president Joaquim Chissano told reporters in Maputo. But the 32-minister government will be run by a prime minister and three deputy prime ministers, who will be chosen by consensus and who will not contest the elections, the accord states. The parties also agreed to create a parliament consisting of a 65- member High Council of Transition and a 258-member Transition Congress as well as organize a referendum on constitutional amendments. Rajoelina wants the constitution to be amended to allow him contest the presidential poll. At 35, he is too young under the current charter. The deal is aimed at ending Madagascar's international isolation, which began in March when then-opposition-leader Rajoelina forced Ravalomanana from office through weeks of demonstrations that eventually won support from a mutinous military. Over 100 people were killed in the unrest. Rajoelina was named interim president after Ravalomanana gave up power and went into exile in South Africa. But the international community dismissed his power grab as a quasi-coup and refused to recognize his administration. The accord, signed by Rajoelina, Ravalomanana and two other former presidents, Didier Ratsiraka and Albert Zafy, early Sunday is a coup for Chissano, who was appointed by the the Southern African Development Community (SADC) to lead the mediation. The key hurdle in the talks was cleared when Rajoelina agreed to pardon Ravalomanana, who was sentenced in absentia to four years in prison for abuse of office over the purchase of a jet. The lifting of the sentence paves the way for Ravalomanana to return to the island and contest the presidential elections. His party is included in the transitional government, but he himself will not be part of it. "In the interests of the nation, and following consultations, it seems reasonable to me to not participate personally in the transition," Ravalomanana said. Asked when he planned to return to Madagascar, Ravalomanana said: "If the political situation is favourable I will return back home" but Rajoelina and Chissano both said the timing was not currently favourable for his return. On returning to Antananarivo on Sunday, a seemingly deflated Rajoelina said Ravalomanana's pardon did not cover the shooting by presidential guards of unarmed civilians during a protest in February. Chissano had said a South African-style truth commission would be established to examine past atrocities. The deal also includes the revocation of charges against ex- dictator Didier Ratsiraka, whom Ravalomanana succeeded following disputed elections in 2001. He had faced 10 years of hard labour and five years in jail for misuse of public funds and threatening state security. Ratsiraka, who is in exile in France, has indicated he would like to return home.