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.

Troops and protesters 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.

The unrest began just over two weeks ago, spurred by a youth-led movement protesting against chronic electricity outages and water shortages across the country. The demonstrations soon escalated to reflect wider dissatisfaction with Rajoelina's government due to high unemployment, rampant corruption, and a rising cost-of-living. Reports of clashes with security forces have resulted in numerous casualties, though government figures dispute the severity of the violence.

Despite the power shift, Rajoelina has attempted to maintain influence, dismissing the impeachment vote by lawmakers and calling it null and void. The international community, including the African Union, has expressed concern over the military's involvement in political affairs.