SNAP ANALYSIS-Opposition takes reins in Madagascar

March 17 (Reuters) - Madagascar's President Marc Ravalomanana's handover of power to the armed forces paves the way for opposition leader Andry Rajoelina to take office and end months of violent power struggle.

* Key to future peace will be whether the army maintains a united stance. The decision by officers to get off their traditionally neutral fence and side with Rajoelina was the tipping point that ultimately isolated the president.

* So far, the signs are positive for stability. Military heads are to back Rajoelina en masse and reject the idea of military government -- a position they have always maintained.

* While the immediate danger of civil war seems to have been avoided, some in the ranks supported Ravalomanana to the end. But the military appears to be quashing dissent for now.

* When Rajoelina is installed, he faces major challenges at home and abroad. His power base is mainly in the capital and if he is deemed to have won power through a military coup, he may be ostracised by the international community.

* International groups such as the European Union and the African Union are united in their condemnation of non-democratic changes of government and can impose sanctions, or cut development aid to offenders -- even though some African Union members have questionable democratic records themselves.

* Ravalomanana's decision to resign, rather than fight to the end, could help the opposition and mute condemnation. If Rajoelina can convince donors he is serious about democracy and hold elections as promised, he may be able to finesse the international reaction.

* There is huge foreign interest in Madagascar from mining and oil firms and plenty of money to be made from tourism, if the country is stable. Dragging much of the population out of poverty is going to be another major challenge for a new leader.

* New mines being developed in Madagascar are far enough from the capital to have been untouched by the disturbances since the start of the year, but continuing uncertainty would discourage new investment as the world economy slows.

* First, though, Rajoelina would need to change the law. At 34, he's too young to be president. Opposition officials say they plan to re-write the constitution and electoral code and hold elections within 24 months.