An elite military unit says it has seized power in Madagascar from President Andry Rajoelina following weeks of youth-led protests in the Indian Ocean island.

Standing outside the Presidential Palace, CAPSAT chief Col Michael Randrianirina said the military would form a government and hold elections within two years. He also suspended key democratic institutions, like the electoral commission.

Gen Z protestors will be part of the changes because "the movement was created in the streets so we have to respect their demands" he added.

Troops and protestors have been celebrating the apparent ousting of President Rajoelina, with thousands cheering and waving flags in the capital, Antananarivo.

Madagascar's constitutional court has named Col Randrianirina as the country's new leader, even though a statement from the president's office said he was still in charge and denounced what it described as an "attempted coup d'etat".