Extremists are penetrating sub-Saharan Africa at an alarming rate, threatening states ill-prepared to deal with the resulting complex social and security challenge, western and African officials have said.

Islamic radical groups, which include Isis, Al Qaeda affiliates and homegrown movements such as Boko Haram, threaten the continent – despite recent defeats at the hands of African armed forces. The encroachment poses unique challenges for policymakers and officials of shaky governments struggling with limited resources.

“The extremists are inside the community – they provide public services where the state has failed,” said Bineta Diop, an official of the African Union. Speaking to The Independent last week at a conference in Marrakesh, Morocco, called Atlantic Dialogues, she added: “They bring water, sanitation, education. They provide opportunities to young people they don’t otherwise have. There is a need to address the basics elements of human security and not leave it to extremists.”

Soldiers from Niger on a joint mission against Boko Haram in Nigeria (AFP/Getty)

African troops backed by western intelligence and security forces have beaten back Somalia’s militant al-Shabaab movement and have made strides against Boko Haram in Nigeria as well as similar groups in Mali. But in some ways, extremists have expanded their presence. Networks of Islamist militants now influence a vast area of Africa, drawing on contacts and resources from the Middle East and Europe, with radical groups exploiting ungoverned spaces throughout the continent.

Major General Christopher Craige, of the US military branch Africa Command, attributed the rise in radicalism in the continent to “lack of strong governments, lack of government services, lack of opportunities”. Speaking at the sidelines of the conference, which was organised by the Moroccan think tank Policy Centre for the New South, he added that extremism was also spreading because “Europe, Africa, and the Middle East are now so connected – not just because of modern media devices, but because of travel”.

Statistics show that terrorist incidents in the Middle East, North Africa, and Europe fell last year, while sub-Saharan Africa held steady, suggesting a shift in focus towards Africa.

“Everything is going south,” said Rida Lyammouri, a researcher at the Policy Centre for the New South, describing militant groups’ expansion in Mali and Burkina Faso. “It’s very alarming. The conflicts have spread.”

Extremist groups infiltrating sub-Saharan Africa often take a different approach to those drawing supporters in European or Arab cities.

Scholars increasingly find it useful to distinguish between radicalisation in urban spaces such as in Europe, or along the Mediterranean coast of North Africa, and rural spaces such as in Mali or rural Nigeria, where radical global aims become fused with local grievances. Countering violent extremism in each area requires different approaches.

“The militant groups in Mali and other places can easily find social empowerment by connecting to tribes or ethnic groups, and make common interest with the community,” said Mostafa Rezrazi, president of the Moroccan Observatory for Extremism and Violence. “At that point, it becomes quite difficult to fight them just as criminals.”

Muslim women in the Brituetterie district of Yaounde in Cameroon, which has seen frequent attacks (AFP/Getty) (AFP/Getty Images))

Mr Lyammouri, who spent a number of months in 2013 and 2014 conducting research among radicalised villagers living along the Niger River in Mali, found that militants often began infiltration by co-opting local leaders and offering help with agriculture and other services.

“It’s more than just radicalisation or ideology,” he said, in a presentation to former diplomats, researchers, and journalists.

“Some of the youth joined did it for money, some joined for ideology. Some joined because they had no other option. There was no state. The groups were providing services that the state wasn’t providing.”

Eventually, the villages began to shun the state instead of begging for services, renaming their towns from local languages for Arabic equivalents, and choosing not to interact with non-radicalised towns. Local leaders were dispatched to Ghana or Ivory Coast to study conservative forms of Islam, and return to preach.

Maj Gen Christopher Craige (far left) and Bineta Diop (second from right) at the Atlantic Dialogues conference in Marrakech last week (Policy Centre for the New South)

“They had a more conservative radical ideology and imposed some extremist ways of life,” said Mr Lyammouri. “Most of the communities were not educated – couldn’t read or write – and were not able to challenge the preachers.”

Why and at what point such communities or individuals within them choose to cross over into violence remains a question. One factor is the spread of violent messages via the internet. But perhaps more important are the mistakes made by governments that prod Islamist groups into violent resistance against the state.

Support free-thinking journalism and attend Independent events

When the French arrived in northern Mali to fight extremists in 2013, the Malian army accompanying them committed atrocities that continue to haunt relations between the state and the locals. The Islamist militant group Ansar al-Islam emerged in Burkina Faso after the armed forces committed atrocities. Even Boko Haram in Nigeria turned to systematic violence only after their supreme leader was summarily executed by security forces following a messy 2009 confrontation.

Even more so than in Europe, Africa’s prisons are threatening to become incubators of radicalism as ordinary prisoners sometimes caught up in dragnets by police are warehoused in harsh conditions with hardened jihadists seeking recruits.

The French embassy in Ouagadougou, the Burkina Faso capital, saw multiple attacks in February (AFP/Getty) (AFP/Getty Images)

African governments also sometimes commit needless blunders that damage their own anti-radicalisation aims. In an effort to stop the spread of Boko Haram, the Nigerian government cut off the road to Lake Chad, destroying the livelihoods of fishing communities, and making them susceptible to the group.

Burkina Faso at one point sought to ban public prayer by Muslims, while Chad passed a law after a suicide bombing banning women from wearing face-covering Islamic garb. “These kinds of moves create a lot of anger towards governments,” said Mr Lyammouri.