BAMAKO, Mali (AP) — African and Western leaders condemned on Wednesday the junta that forced Mali’s president from power, warning the coup was a deep setback for the West African nation that could threaten the battle against Islamic extremism.

Soldiers calling themselves the National Committee for the Salvation of the People promised that they would ultimately hand power to a transitional civilian government but gave no timeline. Junta members urged Malians to return to business as usual.

A day earlier, armed soldiers fired into the air outside President Ibrahim Boubacar Keita’s home and took him into their custody. A distressed Keita announced his resignation on television.

Condemnation of the coup was strong and swift from many quarters, reflecting international concern about instability in Mali and West Africa more broadly amid increasing attacks by Islamic extremists and the ensuing economic fallout, which has been among the drivers of illegal migration to Europe.

The African Union suspended Mali from the bloc and demanded the release of Keita and other detained government officials. Former colonizer France, which has worked to stabilize the country since leading a 2013 military operation to oust extremists from power in the north, called for an immediate return to civilian rule. The United States denounced the coup and urged dialogue.

The West African bloc ECOWAS said it would stop all economic, trade and financial flows and transactions between member-states and Mali.

Ahead of a closed meeting on Mali, the U.N. Security Council “urged those mutineers to release safely and immediately all the officials detained and to return to their barracks without delay.” The U.N. is spending $1.2 billion a year on a peacekeeping mission in the country.

“The priority is to not lose the fight against terrorism,” said a French official who spoke on condition of anonymity because he was not authorized to be publicly named according to official policy.

Tuesday’s developments “represent an enormous setback” after seven years of investment by international partners to address Mali’s insecurity and political challenges, said Judd Devermont, the director of the Africa Program at the Center for Strategic and International Studies.

The country “is going to be paralyzed by the political jockeying over the future, and our ability to work with the government and security services are going to be undercut and restrained,” he said. “This intermediary period is really dangerous for the region’s security.”

Mali was long hailed as a pillar of stability and democracy in West Africa, but it has been beset by violence and instability since 2012, when a coup created a power vacuum that Islamic extremists took advantage of.

Already Tuesday’s takeover has borne worrisome similarities to the 2012 coup — the junta even came from the same military barracks where the last one originated. Many now fear what could happen if those parallels continue. In the wake of the last coup, Islamic extremists seized control of major towns in the north and begin implementing their strict interpretation of Islamic law.

Only a military operation led by French forces could dislodge them, though the extremists merely regrouped in the desert and began launching regular attacks against peacekeepers and soldiers in the area.

In the years since, Islamic extremism has increasingly engulfed not only Mali but also neighboring Burkina Faso and Niger in a region where the U.S. has about 1,400 troops, including special forces.

Tuesday’s coup also marked a worrisome step backward for West Africa, where military power grabs were increasingly becoming a thing of the past. Unpopular rulers in recent years were more likely to be forced into exile than overthrown outright by soldiers in the middle of the night.

After months of anti-government protests amid deteriorating security, Keita’s hand was forced Tuesday. Mutinous soldiers surrounded his residence, fired shots into the air and eventually detained him and his prime minister. Keita later announced his resignation on state broadcaster ORTM. He said the National Assembly would also be dissolved.

Even as the international community condemned the coup, Keita’s departure was met with jubilation by anti-government demonstrators in the capital, Bamako.

“It’s not soldiers who did the coup d’etat — it’s the Malian people who launched a coup," said Djenebou Sidibe, who was among a small group of people who gathered in a square in Bamako to show support for the military.

Keita won the 2013 election in a landslide, emerging from a field of more than two dozen candidates to get more than 77% of the vote. He won reelection five years later, but his political fortunes have tumbled in the year since.

While Mali’s Islamic insurgency started before Keita took office, many felt his government did not do enough to end the violence. The extremists only expanded their reach, infiltrating the central part of the country where they inflamed tensions between ethnic groups. Attacks dramatically increased last year.

Opposition to his government rose further after legislative elections earlier this year that dozens of candidates disputed. In a conciliatory gesture, Keita said he was open to holding the vote again in contested areas. But by June, demonstrators were taking to the streets en masse calling for his ouster.

Analysts said there were few signs that opposition leaders were aware of the coup plot, though they now stand to benefit through an opportunity to serve in any transitional government that emerges.

While Keita had become deeply unpopular, some Malians worried that the future would be worse.

“I condemn the coup d’etat because it won’t advance the country, we’ll keep on being behind,” said Sedou Dolo, sitting at a tea stall in Bamako. “When the army comes they promise us a lot of things, but nothing really happens.”

___

Petesch reported from Dakar, Senegal. Associated Press writers Krista Larson in Dakar, Senegal, Angela Charlton in Paris, and Edith M. Lederer at the United Nations contributed.

Copyright 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.