With a wave of coups in former French colonies in Africa, France is finding it can no longer take its military role on the continent for granted.
There have been growing protests against France's presence in Africa, where it has previously flexed its military might. French troops have recently been expelled from Niger and Mali and others are considering scrapping independence-era deals that led to at least 30 French direct military interventions between 1964 and 1995.
Since independence, France wanted to "perpetuate and safeguard the stability and durability of certain regimes", says Dr Bakary Sambe, director of the Timbuktu Institute.
The former colonial power regarded West Africa and the Sahel as a "space of natural deployment and influence", he says.
Prof Bruno Charbonneau, from Canada's Royal Military College of Saint-Jean and an expert on peace and conflict interventions in West Africa, agrees
"The French military presence in Africa has also always allowed France to be at the heart of conflict resolution and management mechanisms in French-speaking Africa, particularly at the UN Security Council," he says.
Giving military support to friendly African regimes in this manner has meant France can project and protect its own interests, and mount rapid armed interventions, he adds.
The French defence ministry says its primary mission via operations in Gabon is to train soldiers in the region and boost their capabilities to combat terror, protect land borders and maritime territory. This involves peacekeeping, intelligence and logistics.
It says these roles are in line with the Reinforcement of African Peacekeeping Capacities (Recamp) programme, a training initiative set up in the late 1990s involving France, the UK and US.
In Senegal, it works to oversee training across all 15 members of the West African regional bloc, Ecowas, plus neighbouring Mauritania.
Although their numbers have been cut in recent years, several thousand French troops are still deployed in the following countries:
Last month, the 1,300-1,500 soldiers deployed to Niger, along with fighter planes and drones involved in counter-terror operations, began their withdraw from three bases at the request of the leaders of July's coup.
Africa gives France clout on the world stage it otherwise would not have as a "mid-sized power", argues Prof Tony Chafer, of the University of Portsmouth in the UK.
"In an increasingly multipolar and competitive global environment, France has a primary geopolitical interest in maintaining its military presence in the region," he says.
Being in Africa militarily "plays a key role in justifying France's permanent seat on the UN Security Council - France is an 'essential actor' when security issues in West and Central Africa are discussed at the UN or the international community", he adds.
France has carefully guarded its economic and diplomatic links with Africa too. These persist notably with the CFA franc currencies, that are tethered to the French treasury, and via cultivating close bonds with ruling elites.
Prof Chafer says if France still considers the African continent to be its "backyard" it is a product of its colonial history and how it negotiated its exit: "'Pretending to leave so they can dig in deeper', as some have said."
"French armies. Go away," sang Ivorian reggae star Alpha Blondy in the late 1990s. That anthem marked the beginning of a new era of sovereignty.
Yet with the rise of Islamist militancy in West Africa, France took up a request to send in more troops.
The first was Operation Serval, an operation in Mali launched after jihadists overtook the north of the country in 2012. This was replaced by Operation Barkhane, a more regional counter-insurgency mission that ended in November 2022.
Dr Sambe argues that both of them failed as terror groups in the region multiplied during this time.
"Countries began to doubt the importance of France's strategic presence - ideas and conspiracy theories developed suggesting they were somehow attracting or aggravating the terrorist threat," he says.
This together with calls for "sovereignty" coming from a younger generation mean many people want to see the back of French troops.
Recent military coups in Mali, Burkina Faso and Niger - where junta leaders decided to kick out French soldiers and won public praise in the process - are testament to this.
French soldiers withdrew from Mali last year on Bamako's orders, and UN peacekeepers have recently been told to do the same.
As they leave, so does an important deterrent, even if the security situation has worsened over the last decade, argues Prof Chafer.
Since the withdrawals, human rights violations have worsened and Malians are now even less safe, he says.
Mali's army has meanwhile turned to the Russian mercenary group, Wagner, as a new ally. Both parties have been accused of crimes against humanity. Prof Chafer believes Wagner's main role in the country "is not to improve the security of the population but to support the Malian military regime".
It also seems to have shattered a peace deal with an ethnic Tuareg rebel alliance, which has also begun to seize territory in the north as the foreign forces withdraw.
Subcontractors, self-defence militias and paramilitary groups, like Wagner, are not the answer, says Dr Sambe, also pointing to Mali as an example.
He wants to see a pooling of forces from Ecowas, the African Union and the continent's other standby forces.
"It's time to move to towards an Africanisation of these forces," he argues.
Article translated from French and edited by Natasha Booty