- Sahel Islamist insurgency
image sourceEPAimage captionThe Taliban's takeover of Afghanistan has been watched closely by African insurgents
As Afghanistan fell to the Taliban, Islamist groups waging insurgencies in Africa were quick to celebrate.
"God is great," a media outlet linked to Somalia's al-Shabab wrote in response to the takeover.
Elsewhere, the leader of al-Qaeda affiliate Jamaat Nusrat al-Islam wal-Muslimin (JNIM) used his first public message since 2019 to congratulate the Taliban.
"We are winning," Iyad Ag Ghaly said, drawing comparisons between the withdrawal of foreign troops in Afghanistan and France's decision to reduce its military presence in West Africa's Sahel region.
And it is not just Africa's Islamist fighters who have been seeing parallels with Afghanistan.
From Somalia in the east to Nigeria in the west, newspapers have published articles and citizens have taken to social media to share their concerns.
If a wake-up call was needed for African governments heavily reliant on foreign support in their fight against Islamist insurgents, then the Taliban's seizure of Afghanistan is likely to be it.
Fear in Mali
Since 2012, Mali – one of Africa's biggest countries – has been battling various jihadist groups in its northern and central regions.
It has had to rely on French troops and UN peacekeepers to keep the militants from taking control.
However, the presence of soldiers from the former colonial power has been unpopular with some Malians, as well as some in France.
In June, France announced the drawdown of its forces, reducing their numbers to 2,500-3,000 by early next year.
There is concern that Malian troops, who are often poorly trained and ill-equipped, will not be able to contain Islamist groups.
image sourceAFPimage captionThousands of Malians have fled jihadist violence
"Many people are afraid because the situation is likely to be the same [as Afghanistan]," says Bouraima Guindo, editor-in-chief of Mali's Le Pays newspaper.
"The presence of those foreign soldiers is very necessary because if they leave tomorrow, the situation will be more dangerous."
Like other publications in Mali, Le Pays has called on the country's leaders to do more to strengthen its armed forces.
Running out of time in Somalia
There is also concern in Somalia, which has drawn some of the strongest comparisons to Afghanistan.
Somalia suffered state collapse and decades of civil war before an insurgency by the al-Qaeda-affiliated al-Shabab group began in the mid-2000s.
The internationally backed government has struggled to regain control of much of the country and is reliant on African Union troops operating under a UN Security Council mandate.
image sourceSOMALI ARMY / HANDOUTimage captionThe Somali military is fighting Islamist group al-Shabab
The goal has been to uproot the militants while giving the government time to build institutions.
But as in Afghanistan, there have been widespread accusations of corruption. There have also been clashes in the capital this year over delayed elections, which saw parts of the security forces turn on each other.
These issues have raised doubts over Somalia's state-building project.
Ilham Gassar, a political advisor to the UN mission in Somalia, says international partners had been focusing on destroying al-Shabab, not developing a strong state.
"The focus was never to make the average Somali's life better and to create systems of sustainability," she says.
The Somali government was meant to take the lead on security operations by the end of this year, but that looks unlikely due to questions over the army's capability.
Samira Gaid, head of Somali security think-tank Hiraal Institute, says Somali forces are even less prepared to halt a potential militant offensive than those in Afghanistan.
"Somali security forces have not received 0.005% of what the Afghan security forces have received," she says.
"Tangible support towards the rebuilding of the Somali security forces has been minimal. Somalia is still under an arms embargo, so we are unable to purchase the type of weaponry that Afghanistan had."
But even in Somalia the focus has shifted to how and when to end foreign assistance.
The EU has already started cutting back its funding, and the government is running out of time to get itself ready to be self-sufficient.
As in Afghanistan, Islamist movements in Africa have flourished in countries where they have been able to capitalise on weak state institutions, a lack of services like education and healthcare, and issues with poverty.
These factors led to the emergence of insurgents in Mozambique's Cabo Delgado region, and were used by groups in West Africa as a way to recruit fighters and gain public support.
In some cases, insurgents have stepped in to provide services and better justice in communities, which has helped them gain legitimacy.
image sourceAFPimage captionFrance is reducing its military presence in Africa's Sahel region.
There is a general acceptance across Africa that military operations will not be enough to eradicate violent extremism and that more needs to be done to find political solutions – perhaps even negotiating with insurgents.
But security expert Fulan Nasrullah says it would be a shock if any of the Islamist groups in West Africa were to capture a state and hold it.
"People should not interpret Africa or every other jihadi Islamist group through the prism of what just happened in Afghanistan – the contexts are different but there are a few similarities," he says.
The groups fighting in West Africa are not a cohesive force like the Taliban, they are a mixture of various militias, whose goals sometimes align but not always and increasingly the global contest between IS and al-Qaeda has seen their affiliates fighting each other.
West Africa's Islamist groups "exist in a climate where the state is weak, but they are weaker than the weak states", Mr Nasrullah says.
Lessons to be learned
It is too soon to know how developments in Afghanistan might affect policy in Africa. But the conversation has begun on how to ensure a better exit for foreign powers.
Comfort Ero, from the International Crisis Group think-tank, says there are "immediate lessons" to be learned.
She says there is a "perennial problem of governments mired in corruption, heavily dependent on foreign/external support, with little or sometimes flimsy legitimacy at home, so that when international support is withdrawn, what we are left with are artificial states unable to extend their remit".
Amid the shocking scenes of people trying to flee Afghanistan, Ms Gaid says she believes there would be a "pause on the part of international partners" to ensure there were not similar situations in countries like Somalia.
"It will be more staggered, and they will be more deliberate about an eventual exit," she says.
You might also be interested in:
- BACKGROUND: Critical stage for fight against jihadis in West Africa
- ANALYSIS: Radical rethink in fighting insurgencies
- VOICES: The deadly flight from Mozambique's jihadist attack
media captionAfrica Eye investigates the cycle of death, violence and corruption in Mali's military