France's ambassador to Niger left the country early on Wednesday morning, around one month after the military government ordered his expulsion and days after President Emmanuel Macron said the diplomat would be pulled out and French troops withdrawn.
Relations between Niger and France, its former colonial ruler which maintained a military presence in the country to help fight Islamist insurgents, have broken down since army officers seized power in Niamey in July.
The junta had ordered French ambassador Sylvain Itte to leave the country within 48 hours at the end of August in response to what they described as actions by France that were 'contrary to the interests of Niger.'
France at first ignored the order, sticking to its stance that the military government was illegitimate and calling for the reinstatement of elected President Mohamed Bazoum, who was toppled in the July coup.
But Macron announced on Sunday that the ambassador would return to Paris and French troops would leave.
Two security sources in Niger said Itte had flown out of the country. The news was later confirmed by the president's office in Paris.
There have been almost daily protests against France in Niamey since the military took power. Crowds of junta supporters have spent days camping outside a French military base to demand the troops' departure.
Macron had said Itte and his staff were effectively being held hostage at the embassy.
Anti-French sentiment spreads
Niger is just one of France's former colonies in West Africa where there has been growing anti-French sentiment both among the population and the authorities, especially in countries where military rulers have seized power.
Mali, Burkina Faso, Chad and Niger are now all run by army officers following a spate of coups over the past three years, and anti-French rhetoric has been a recurring feature of their public pronouncements.
Critics of France say that for decades after its former colonies gained independence, it sought to maintain strong economic and political influence through a system of overt and covert diplomacy known as 'Francafrique.'
The French government says the days of Francafrique are over and operations like the one in Niger were being conducted with the full consent, knowledge and cooperation of local governments, such as Bazoum's now defunct administration.
While France's critics accuse Paris of continuing to exert excessive and disruptive influence in the region, some analysts say military juntas are using France as a scapegoat for hard-to-solve problems.
The juntas in Mali and Burkina Faso have already kicked out French forces deployed to help fight a decade-long Islamist insurgency that has killed thousands and displaced millions across the Sahel region.
Some analysts have expressed concern that the withdrawal of French troops from Niger could further hamper Western efforts to stem the violence, which has risen since the coups, and bolster Russian influence in the region.