The military in Burkina Faso says it has seized power and overthrown President Roch Kaboré.
The announcement was made on state television by an army officer, who said both the government and parliament had been dissolved.
Mr Kaboré's whereabouts are unclear, but the officer said that all those detained were in a secure location.
The coup comes a day after troops seized barracks, and gunshots were heard in the capital.
Earlier, the ruling People's Movement for Progress (PMP) party said that both Mr Kaboré and a government minister had survived an assassination attempt.
On Sunday, mutinying troops demanded the sacking of military chiefs and more resources to fight Islamist militants.
The army statement cited the worsening security situation and Mr Kaboré's alleged inability to unite the nation as reasons for overthrowing him, AFP news agency reports.
The statement was issued in the name of a group not heard of previously, the Patriotic Movement for Safeguard and Restoration or MPSR, its French acronym.
"MPSR, which includes all sections of the army, has decided to end President Kabore's post today," it said.
Before the announcement, the African Union and the West African bloc Ecowas condemned what they called an attempted coup in Burkina Faso.
Ecowas said they held the military responsible for Mr Kaboré's safety.
Video from the capital appears to show armoured vehicles - reportedly used by the presidency - peppered with bullet holes and abandoned in the street.
Mobile internet services have been disrupted, though fixed-line internet and domestic wi-fi are working
Mr Kaboré has not been seen in public since the crisis began but two posts appeared on his Twitter account before the officer announced he had been toppled.
The later one called on those who had taken up arms to lay them down "in the higher interest of the nation". Earlier Mr Kaboré congratulated the national football team on their win in an Africa Cup of Nations match.
It is unclear whether Mr Kaboré or someone else posted the tweets.
Some security sources say the president and other government ministers are being held at the Sangoulé Lamizana barracks in the capital.
On Sunday, hundreds of people came out in support of the soldiers and some of them set fire to the ruling party's headquarters. A night-time curfew has since been imposed.