New feature: Check out news exactly for YOU ➡️ find “Recommended for you” block and enjoy!
Their campaign began in northern Mali a decade ago, advanced into the country's powder-keg centre and from there into neighbouring Niger and Burkina Faso.
Now, fears are growing that the ruthless jihadists wreaking havoc in the Sahel are heading towards coastal West Africa.
Following multiple incursions including deadly attacks in the northern regions of Benin, Ivory Coast and Togo, governments in the Gulf of Guinea are reviewing their strategy.
Their chief concerns, say analysts: how to avoid replicating the mistakes of their neighbours in the Sahel, and how best to muster foreign support.
After Mali's junta took power in August 2020, the country's ties with Paris went into a downward spiral, triggering a withdrawal of French troops that was completed on Monday.
Last month, Benin President Patrice Talon told his French counterpart Emmanuel Macron that his country needed more equipment, especially drones.
PAY ATTENTION: Enjoy reading our stories? Join YEN.com.gh's Telegram channel for more!
Among coastal states, northern Benin has been the most affected by the expanding jihadist threat, with around 20 attacks against security forces since late 2021.
"What we are going through is terrifying," a Beninese officer deployed at the border with Burkina Faso told AFP, speaking under condition of anonymity.
"We wake up every morning without knowing if we will survive the day," he added.
Macron has said that France, despite its exit from Mali, is committed to the "fight against terrorism" in West Africa.
He said he is ready to participate in meetings of the "Accra Initiative" -- a body set up in 2017 to boost security cooperation between countries in the region.
"The deteriorating security situation in Burkina Faso and Mali has made the north of the coastal countries the new front line against armed groups operating in the Sahel," the Konrad Adenauer Foundation, a German think tank, said in a report in April.
Countries in the region have beefed up security in vulnerable areas, including Ghana, which so far has been spared attacks.
But whether this will work is the big question.
Shoring up border security will be "ineffective, (just) as it was in the Sahel," the Moroccan Policy Center for the New South think tank warned this month.
Jihadist groups in the Sahel "are not traditional armies," it said. "They spread ideas and exploit the grievances of target populations."
Jeannine Ella Abatan at the pan-African Institute for Security Studies in Senegal described the rash of recent attacks as "the tip of the iceberg."
"Since 2019, studies on the Sahel show that extremist groups were already connected to coastal states, either for logistical or operational support, but also for financing," she told AFP.
Militants do not occupy territory in the coastal countries but instead infiltrate northern regions where they conduct sophisticated attacks, Abatan said.
Togo first experienced a jihadist attack in May 2021. Benin's first known fatal attack was last December, when two soldiers were killed near the border with Burkina Faso. In Ivory Coast, four members of the security forces died in 2021, after 14 in 2020.
Such attacks, said Abatan, are only possible thanks to good intelligence-gathering capabilities and the "complicity" of locals.
Increased recruitment among border populations is a major threat, she said.
"The difficult living conditions can easily encourage desperate people into the camps of terrorists," a Beninese police officer in the troubled region told AFP.
Last week, a widely-shared propaganda video featuring two jihadists speaking Bariba, the local language in northern Benin, called on people to join them and threatening those who collaborate with the state.
"The state must urgently respond to the needs of these people -- make them feel protected by the presence of security forces instead of letting them seek protection from these groups," Abatan said.
Amnesty International has warned of alleged human rights violations committed by security forces in Benin and Togo, as well as arbitrary detentions.
Coastal countries seem to have accepted the argument that poverty and other sources of resentment create a potential pool for recruitment.
In Benin, the government has launched development projects, building schools and hospitals in some underdeveloped areas, and millions of dollars have been invested in Ivory Coast.
But much more needs to be done, says the Moroccan think tank, which also gives a specific warning against militarisation of the border areas.
"Without an immediate and dramatic change of approach," it warned, residents in these border areas will "collaborate with extremists to keep themselves alive as best they can."
New feature: Check out news exactly for YOU ➡️ find "Recommended for you" block and enjoy!