PARIS — French President Emmanuel Macron on Thursday announced a "profound transformation" of France's military engagement in West Africa, ending a major operation as security concerns mount.

France has about 5,100 soldiers stationed across the region as part of Operation Barkhane, focused on curbing insurgencies in Mali, Niger and Burkina Faso. It was not immediately clear how many troops would remain or when departures would begin.

Macron said Barkhane would be replaced by a new operation, with its aims being supported by other nations. He said the decision followed consultation with the United States and European Union nations.

The announcement came days after Mali, a nation of roughly 20 million, named a new acting president: Col. Assimi Goïta, the leader of its second coup d’etat in nine months. France suspended joint operations with the Malian military last week after the latest military takeover.

Domestic pressure on Macron to draw Operation Barkhane down has risen ahead of presidential elections next year, amid deadly attacks on French soldiers and as questions grow about whether the mission has had a significant impact on security in the region.

“They ended up in their equivalent of our Afghanistan,” said Peter Pham, a former U.S. special envoy to the region. “There’s no denying they did some good — like taking out key terrorist leaders — but they didn’t define a victory or an end state, much less how to get there.”

French forces have been stationed in Mali since 2013, when troops intervened to halt an extremist takeover. Their continued presence has been seen as a key pillar of Western counterterrorism efforts in the region.

France has portrayed itself as carrying an outsize share of the security burden compared with its U.S. and European counterparts. The United States has about 1,100 troops in West Africa, according to U.S. Africa Command. Unlike their French counterparts, they perform mostly intelligence and logistics.

Other European nations also have troops stationed in the region. One French official, speaking on the condition of anonymity because the official was not authorized to talk on the record, said Macron’s words were a message to France’s European and regional allies to double down on their military commitments.

Analysts say French troops form a crucial blockade in Mali. Violence has surged in recent years as fighters linked to al-Qaeda and the Islamic State have pushed to dominate more territory, transforming once peaceful areas into conflict zones.

Nearly 7,000 people died in the violence in 2020, the deadliest year for Mali, Burkina Faso and Niger since extremists invaded almost a decade ago.

“Now is not the time for France to abandon Mali,” said Boubacar Ba, a security analyst in Bamako, Mali’s capital. “To abandon Mali is to abandon the Sahel. It is to open Pandora’s box for Europe.”

Mali’s government has largely lost control of the nation’s arid north and center to extremist groups, and the Malian army — small by regional standards — has said it lacks the funds to eradicate the security threat on its own. Porous borders enable fighters to easily scatter.

Neighboring Burkina Faso endured its worst massacre in years over the weekend. Recently, attacks have erupted closer to the region’s coastal states. Fighters ambushed soldiers this week on the Ivory Coast border, killing at least one soldier.

Protesters in Mali and its neighboring countries see the French military presence as contributing to the deterioration of security.

Criticism spiked in March after the United Nations reported that a French airstrike in central Mali this year had killed 19 civilians. Witnesses told The Washington Post that warplanes had dropped bombs on a wedding. France’s defense minister described the target as a group of extremists.

The French military presence has at times sparked violent protests. Demonstrators have attacked and looted French businesses in West Africa.

Macron has condemned the mounting animosity toward France. He told the French newspaper Le Journal du Dimanche recently that France wasn’t meant to maintain a permanent military presence in West Africa.

But his announcement Thursday will affect countries that have been perceived as reliable partners.

Niger’s foreign minister, Hassoumi Massaoudou, told The Post on Thursday that “the countries of the region must coordinate their efforts to combat and defeat terrorism.”

“Unity is strength against the common enemy,” he said.

Paquette reported from Agadir, Morocco.