On August 15, the last French soldier left Mali, officially ending Paris's nine-year military presence inside the country. The French Ministry of Armed Forces rightly praised the performance of its troops, who executed a six-month withdrawal with daunting logistical implications involving 2,500 personnel, 4,800 containers and 1,800 vehicles. But this technical achievement hardly hides the fact that the retreat is, first and foremost, a result of a diplomatic crisis between France and Mali. More critically, it leaves the Sahel region in an uncertain security environment. France's intervention in Mali began on January 11, 2013 to prevent a takeover of Bamako, the capital city, by extremists. The operation, greenlighted by then French president Francois Hollande, was initially hailed as a swift success – to the extent that Mr Hollande received a warm welcome during his visit to Bamako a month later. The cheers, however, quickly faded away, as Mali’s then president, Ibrahim Boubacar Keita, struggled to return good governance to a country plagued by corruption and underdevelopment. The terrorist threat resurfaced soon enough. By now, extremist groups refocused their attacks on the tri-border area between Mali, Burkina Faso and Niger. This forced France to broaden the scope of its mission; from 2014, its so-called Operation Barkhane not only spanned Mali but the entire Sahel band. A new regional entity called the G5 Sahel, meanwhile, was established to include Mauritania, Burkina Faso, Niger, Chad, and Mali. For Paris, the objective of Operation Barkhane was to support the G5 Sahel towards the gradual transition to local armed forces. Despite these diplomatic arrangements, the security environment kept worsening in Mali. Increasingly resentful of Keita's leadership, Bamako's military commanders led by Col Assimi Goita overthrew the president. The coup left French President Emmanuel Macron in a conundrum. Should he give priority to the counterterrorism missions under way by supporting the military, or should he stand for democratic principles by rejecting the coup? At first, Paris tried to find a third way, calling for the return to the rule of law in Mali while maintaining co-operation with its armed forces. By May 2021, however, this gamble proved unsustainable. The junta not only kept postponing its planned transition to democratic rule, but its leaders increasingly saw France as a rival, rather than a partner. For sure, French influence in Bamako under Keita's presidency had fed local discontent for what was perceived by opponents to be a form of neo-colonialism. But after 2020, the military rule built on that resentment to cement its own domestic legitimacy vis-a-vis the foreign power. Mali, moreover, asked a Russian private security company, Wagner Group, to deploy contractors in the country – a move that was perceived as openly antagonising France. The bilateral relationship then unravelled in the first months of 2022, with Bamako ordering the immediate retreat of French forces and the suspension of the defence agreements between the two countries. The August 15 withdrawal possibly marks the end of an era in France-Mali relations, but the future of the fight against terrorism in Western Africa remains uncertain. Although the military in Bamako argued domestically that it would do a better job than the erstwhile civilian leadership and its foreign partners in combatting the armed groups, it has so far failed to curb the tide of terror attacks. Just a week before the withdrawal, 42 Malian soldiers died in co-ordinated attacks launched by militants on the city of Tessit. Five days later, another assault led by ISIS killed 20 people in the Menaka region. Meanwhile, in Paris, Mr Macron and his advisers have had to rethink their regional strategy. The retreat from Mali, which hosted about half of French troops for the Sahel, implied a rebalancing of resources and personnel among the other partner countries, namely Burkina Faso, Chad and Niger. The latter now constitutes the centre of gravity for Operation Barkhane, although authorities in Niger have carefully downplayed the significance of that move. Niamey maintains close ties with Paris, but Nigerien President Mohamed Bazoum, who was elected last year, is mindful of the political risks in maintaining close ties with French forces. Noticeably, the official communique from Mr Macron's office on the military retreat from Mali did not mention Niger. At the same time, Paris seems intent on finding new regional partners in its counterterrorism operations. Mr Macron's visit to Cameroon, Benin and Guinea-Bissau last month emphasised the growing importance of both the Gulf of Guinea and the Chad basin region towards this end. In recent years, the scope of the terror attacks conducted by groups such as Boko Haram and ISIS's West Africa Province have steadily widened, which has only increased the need for greater regional co-ordination. The difficulty for Paris, however, is that it is having to draw down its forces from the region during this critical period. From deploying 5,000 soldiers a year at the height of Operation Barkhane, it is today sending just 3,000 of them. This reduction is being driven less by military requirements than it is by domestic political considerations. Having lost his majority in the National Assembly in June, Mr Macron no longer has the political capital to sustain a military operation that is increasingly being viewed by his critics as France’s "forever war".