In Burkina Faso, a captain announced on national television that he had overthrown military leader Lieutenant Colonel Paul-Henri Damiba.
Ibrahim Traore cited Colonel Damiba’s inability to deal with an Islamist rebellion as the reason.
It also announced that borders were closed indefinitely and all political activities were suspended.
Lieutenant Colonel Damiba’s junta overthrew an elected government in January, arguing that it had failed to stop the Islamist attacks.
But his administration failed to suppress the jihadist violence. On Monday, 11 soldiers accompanying a convoy of civilian vehicles in the north of the country were killed.
Earlier on Friday, Lieutenant Colonel Damiba urged the public to remain calm after intense gunfire was heard in parts of the capital.
More than 20 armed soldiers – most with their faces covered – appeared on state television shortly before 20:00 local time.
“Faced with the deteriorating situation, we tried several times to get Damiba to refocus the transition on the security issue,” said the statement signed by Traore.
“Damiba’s actions gradually convinced us that his ambitions were distracting us from what we wanted to do. Today we decided to remove Damiba,” he said.
In addition, a curfew was declared between 21:00 and 05:00.
The US said it was “deeply concerned” by events in Burkina Faso and encouraged its citizens to limit movements in the country.
“We call on all actors to return to calm and restraint,” said a spokesperson for the State Department.
Before dawn, gunfire and explosions were heard in the capital, Ouagadougou, some coming from near the presidential palace and the main military barracks.
After sunrise, the normally bustling city was largely abandoned, with soldiers blocking some roads in the streets and guarding key strategic points.
State television stopped broadcasting, and more gunshots were heard later in the day.
Lieutenant Colonel Damiba said there was a “confusion” created by “mood swings” among some soldiers as rumors of the coup intensified.
Calling on people to stay calm and avoid social media speculation, the military leader said “negotiations are ongoing to restore calm and serenity”.
In January, Lieutenant Colonel Damiba dismissed President Roch Kabore, saying he was unable to cope with the growing militant Islamist violence.
“We have more than it takes to win this war,” the junta chief said when he took office in February.
But many citizens do not feel safer, and there have been protests across the country this week.
On Friday afternoon, some protesters took to the streets of the capital to demand the impeachment of Lt Col Damiba.
The Islamist insurgency erupted in Burkina Faso in 2015, killing thousands and forcing an estimated two million people from their homes.
The country has experienced eight successful coups since independence in 1960.