Burkina Faso's army has ousted President Roch Kabore, suspended the constitution, dissolved the government and the national assembly and closed the country's borders.
The announcement on Monday cited the deterioration of the security situation and what it described as Mr Kabore's inability to unite the West African nation and effectively respond to challenges it faces, which include an Islamist insurgency.
Signed by Lieutenant Colonel Paul-Henri Sandaogo Damiba and read by another officer on state television, the announcement said the takeover had been carried out without violence and that those detained were at a secure location.
The statement was made in the name of a previously unheard-of entity, the Patriotic Movement for Safeguard and Restoration, or MPSR, its French-language acronym.
"MPSR, which includes all sections of the army, has decided to end President Kabore's post today," it said.
Army putsches have toppled governments over the past 18 months in Mali and Guinea.
The military also took over in Chad last year after President Idriss Deby died fighting rebels on the battlefield in the country's north.
A crowd gathered Place de la Nation celebrate at the announcement that Lt. Col. Paul Henri Sandaogo Damiba has taken the reins of the country Source: AP
The MPSR said it would propose a calendar for a return to constitutional order "within a reasonable time frame, after consultations with various sections of the nation".
The army broadcast came after two days of confusion and fear in the capital Ouagadougou, where shooting erupted at army camps on Sunday, with soldiers demanding more support for their fight against Islamist militants.
Mr Kabore's whereabouts were unknown on Monday after intense gunfire was heard in the area around his residence overnight.
Earlier, his party said he had survived an assassination attempt, but gave no details. It also said his personal residence had been sacked.
Before the army statement, the African Union and the West African bloc ECOWAS both condemned what they called an attempted coup in Burkina Faso, saying they held the military responsible for the former president’s safety.
Incumbent President Roch Marc Christian Kabore casts his ballot in the presidential elections in Ouagadougou, Burkina Faso, 22 November 2020. Source: EPA
The landlocked country, one of West Africa's poorest despite being a gold producer, has experienced numerous coups since independence from France in 1960.
Islamist militants control swathes of Burkina Faso and have forced residents in some areas to abide by their harsh version of Islamic law, while the military's struggle to quell the insurgency has drained scarce national resources.
Mr Kabore had faced waves of protests in recent months amid frustration over killings of civilians and soldiers by militants, some of whom have links to IS and al-Qaeda.
Several armoured vehicles belonging to the presidential fleet could be seen near Mr Kabore's residence on Monday, riddled with bullets. One was spattered with blood.
Security sources gave conflicting accounts of the former president’s situation, with some saying he was being detained by the coup organisers and others saying forces loyal to him had taken him to a secure location.