RABAT, Morocco (AP) — France said Thursday that Burkina Faso released four French nationals it had detained for a year, following negotiations mediated by Morocco.

France’s Elysee Palace said in a statement that President Emmanuel Macron thanked Morocco’s King Mohamed VI for mediating discussions that led to their release.

Morocco’s Ministry of Foreign Affairs called it a “humanitarian initiative” and lauded its own role in mediating between the two countries.

France’s Defense Minister Sebastien Lecornu posted on X that the detainees were armed forces members.

The four French nationals were arrested in Ouagadougou in December 2023 on what Jeune Afrique and French media reported as espionage-related charges. Their detention came at a low point in France’s relations with its former colonies in the Sahel, including Burkina Faso. After two coups, the landlocked nation of 20 million people expelled French forces and turned to Russia for security support.

The ruling junta has since joined forces with neighboring countries to form the Alliance of Sahel States. The alliance’s three countries — Mali, Niger and Burkina Faso — have each struggled to contain the security and humanitarian crises.

Amid France’s retreat in the Sahel, Russia, Turkey and the United Arab Emirates have each sought to expand security and trade partnerships in the region. Morocco has also aspired to play a larger role as a diplomatic mediator and economic partner, launching new initiatives to deepen ties and build infrastructure giving landlocked nations new gateways to access the Atlantic Ocean.