Madagascar's President Marc Ravalomanana has stepped down and transferred power to the military.  The resignation follows weeks of confrontation with the opposition led by the former mayor of the capital, Andry Rajoelina.

Madagascar's President Marc Ravalomanana Tuesday announced on national radio that he was resigning as head-of-state and was handing power to a military directorate headed by a navy admiral, Hyppolite Ramaroson.

Supporters of opposition leader Andry Rajoelina said they would head a transitional government, re-write the constitution and organize elections in two years.

But it was not clear whether the opposition's claim was part of any agreement.  The African Union, which has strongly condemned any unconstitutional transfer of power, quickly issued a statement saying the military should not hand power to the opposition.

Soldiers backing Rajoelina seized a presidential office in central Antananarivo on Monday and the former mayor of the capital city installed himself as president of an interim government.

The head of the armed forces who backs the opposition, Colonel Andre Ndriarijaona, Monday promised to restore calm and order.

He says he does not want anyone, especially Mr. Ravalomanana, to stay in power. And thirdly, the colonel said he did not want anyone to pay poor people to create troubles.

Rajoelina had called for the arrest of Mr. Ravalomanana whom he accuses of dictatorship, mismanaging public funds and of being responsible for more than 100 deaths during the weeks of confrontation.

The president told supporters Monday at his residence outside the city that he would resist a take over, which he called unconstitutional.

A lawyer and political analyst in the Malagasy capital, Sahondra Rabenarivo, notes that Madagascar's constitution makes it difficult to dismiss a sitting president.

"The constitution is a very presidential constitution modeled on the French constitution with enormous powers for the president," she said.  "It is almost like a presidential monarchy."

She says under the constitution a president's term can only end prematurely through resignation, death or dismissal by a two-thirds majority of parliament.  Mr. Ravalomanana controlled the assembly.

As a result, she says the resignation smoothes the path for a transition that nevertheless will be difficult because the former president enjoyed considerable support, especially in rural areas.

In addition to the African Union, European governments and the United States have made it clear that they will impose sanctions on any new government installed illegally.