The last soldiers belonging to France's in Mali have now left the African country, the French chiefs of staff said on Monday.
French forces have been supporting against insurgents for nearly a decade, but decided to pull out after France and the Malian junta fell out in the wake of a military takeover.
"Today at 13H00 Paris time (1100 GMT) the final contingent of the Barkhane force still on Malian territory crossed the border between Mali and Niger," the statement said.
The army had met the "major military logistics challenge" of the pull-out "in an orderly and safe fashion", it added.
After ties ruptured between Paris and the junta that took power in in August 2020, France began to withdraw its troops in February, as jihadist violence surged in the Sahel.
Friction developed over the junta's delays in restoring civilian rule and escalated when Mali brought in Russian paramilitaries - personnel described by France as "mercenaries" from the .
Macron on Monday congratulated the military on its nine years in Mali, saying it had "prevented the establishment of a territorial caliphate, and fought against terrorists that attack local populations and threaten Europe".
Most high-ranking members of the "terrorist groups" had been "neutralised", he said, adding that 59 had died in Mali in total.
More than 2,000 civilians have been killed in Mali, Niger and Burkina Faso since the start of the year, according to an AFP tally based on the findings of non-governmental organisation ACLED.
At its peak, F had 5,100 troops among five Sahel allies, all former French colonies - Burkina Faso, Chad, Mali, Mauritania and Niger.
The forces have provided key support in air power, troop transport and reconnaissance. France has an air base in Niger's capital Niamey where it has deployed drones.
After the Malian pullout, the mission will have "around 2,500" troops, Barkhane commander General Laurent Michon said last month.
The reconfigured mission will emphasise "more cooperative operations," he said.
France will keep more than 1,000 men in Niger, where a tactical group will continue to work in partnership with the Nigerien forces.
is a frontline state in the fight against jihadism as the unstable region struggles with a string of military coups.
"The democratic regression in West Africa is extremely worrying," French Foreign Minister Catherine Colonna told French MPs ahead of a trip to the region in July.
"However, in spite of these events (and) the withdrawal from Mali, France will continue to help West African armies fight terrorist groups".
Niger is one of the biggest recipients of French aid, receiving 143 million euros ($146 million) last year.
The two sides will sign agreements for a French loan of 50 million euros and a grant of 20 million euros.
, the world's poorest country by the benchmark of the UN's Human Development Index, has been badly hit by the jihadist insurgency that began in northern Mali in 2012 and then swept to neighbouring countries.
Niger is facing insurgencies both on its western border with Mali and Burkina Faso and on its south-eastern frontier with Nigeria.
More than a thousand troops will be deployed in Niger, providing air support and training, according to French sources.
are also in Gabon, Ivory Coast and Senegal, as well as in the east of Africa, in Djibouti.
Macron in June asked the government and military chiefs "to rethink our overall presence on the African continent by the autumn".
He called for "a presence that is less static and less exposed" and "a closer relationship" with African armed forces.