OUAGADOUGOU, Burkina Faso — Gunfire erupted at military bases across this conflict-hit West African country early on Sunday as part of an attempted mutiny by soldiers angered by their government’s failure to halt a wave of Islamist militant attacks.
The firing started just before dawn at military bases in the capital, Ouagadougou, and in two other cities. When the shooting subsided hours later, the government issued a statement denying that a coup was underway and insisting that it was fully in control.
Even so, soldiers retained control of the bases and demanded sweeping changes to the campaign against Islamic militants, badly undermining the government’s authority. Riot police officers fired tear gas in central Ouagadougou to prevent a crowd of young demonstrators, calling for the ouster of President Roch Marc Christian Kaboré, from reaching a traditional protest site in the city center. Mobile internet services were shut down.
By nightfall a state of uneasy calm had fallen across the city, with a smaller number of protesters gathered outside the gates of a major military base, urging the mutinying soldiers to seize power outright. There was no sign of Mr. Kaboré, whose only public action during the day was to post a message on Twitter in support of the national soccer team, which was playing a major game.
Burkina Faso won that game against Gabon in a penalty shootout, advancing to the next stage of Africa’s premier soccer tournament. The government’s fate was less clear.
Appearing on state television, Defense Minister Barthélémy Simporé said that the unrest was confined to “a few barracks” and that the government had reached out to the mutinying soldiers to learn their demands.
The mutiny comes a few months after Mr. Kaboré changed the military leadership in what analysts saw as an attempt to quell opposition in the armed forces. Earlier this month the government arrested a dozen soldiers on suspicion of conspiring against the government.
The United States Embassy in Burkina Faso reported gunfire at five military bases in the capital and in the northern towns of Kaya and Ouahigouya.
“This is, sadly, totally predictable,” said Corinne Dufka, West Africa director at Human Rights Watch. “This is what happens when rule of law and transparency is weak. The situation is all the more precarious given the template for coups in the region.”
The unrest also coincides with a broader violent upheaval and precipitous democratic backsliding in the region.
A wave of Islamist violence in the Sahel region has intensified in the past year, with 2,000 deaths in Burkina Faso alone. Over 100 people died in an attack on a village in northern Burkina Faso in June, one of the deadliest in the region for years. On Sunday France said that one of its soldiers had been killed in a mortar attack on a camp in Gao, in neighboring Mali.
Public anger at Mr. Kaboré’s failure to stem the violence, which has destabilized broad areas of Burkina Faso’s east, west and north, has fueled a wave of protests in recent months and stoked fears of a coup.
There has been a surge in military takeovers across sub-Saharan Africa in the past year, with soldiers seizing power in Chad, Guinea, Mali and Sudan. In November, the United Nations special envoy to West Africa warned that Burkina Faso might be next.
Since October, Burkina Faso has been gripped by the much-anticipated trial of 14 people in the 1987 overthrow of President Thomas Sankara, a young leader whose progressive ideals inspired many Africans. Mr. Sankara’s violent death during the coup, led by a former friend, cast a decades-long shadow across the country.
The first sign of trouble on Sunday was a burst of sustained gunfire before dawn at Sangoulé Lamizana, a military camp in central Ouagadougou that houses a prison whose inmates include soldiers involved in a 2015 coup attempt.
Speaking to reporters outside the camp, one officer gave a list of demands including the replacement of Burkina Faso’s army chief and intelligence chief, greater resources for the military campaign against Islamist militants and improved medical care for soldiers wounded in the fight.
A surreal air pervaded the city for the rest of the day. Unable to reach the city’s Place de la Nation, where riot police officers fired tear gas, protesters burned tires and closed down a major road.
Nearby, soldiers continued to occupy a major military base, from which bursts of gunfire occasionally rattled.
But in the rest of the capital, residents continued with church services in the morning and crowded into cafes during the afternoon to watch their team play in the Africa Cup of Nations.
“I don’t have time for the protests,” said Dennis Konombo, 23, a car washer with a flag wrapped around his head who shouted with joy when the team scored a goal. “We just want peace.”
But for others, the only solution was to fire the government. In November protesters clashed with the riot police, reflecting widespread anger over the Islamist militancy, which since 2015 has badly destabilized Burkina Faso, until recently a poor but largely quiet West African country.
The government tried to prevent another round of protests that erupted Saturday. Several hundred young people, some throwing stones, clashed with police officers, who responded with tear gas. A journalist was injured in the unrest.
Open support for the government’s ouster was evident on the streets of the capital, where a semblance of normalcy persisted on Sunday despite the turmoil.
Amed Ouedrago, a 32-year-old trader, sold national flags on the roadside in advance of the soccer match between Burkina Faso and Gabon.
“We want the military to take over,” Mr. Ouedrago said amid occasional bursts of gunfire from the nearby Sangoulé Lamizana base.
Struggling to find takers for his 75-cent flags, the trader said he himself had participated in earlier rounds of protest. “People are frustrated, yet the police respond with tear gas,” he said. “Now we are back on the streets again. We want someone new in power.”