Taliban are back - what next for Afghanistan?
After 20 years of war, the Taliban has swept to victory in Afghanistan.
The group completed their shockingly rapid advance across the country by capturing Kabul on 15 August.
It came after foreign forces withdrew from Afghanistan following a deal between the US and the Taliban, two decades after US forces removed the militants from power in 2001.
The conflict has killed tens of thousands of people and displaced millions.
Taliban forces have pledged not to allow Afghanistan to become a base for terrorists who could threaten the West.
But questions are already being asked about how the group will govern the country, and what their rule means for women, human rights, and political freedoms.
Why did the US fight a war in Afghanistan and why did it last so long?
Back in 2001, the US was responding to the 9/11 attacks on New York and Washington, in which nearly 3,000 people were killed. Officials identified Islamist militant group al-Qaeda, and its leader Osama Bin Laden, as responsible.
Bin Laden was in Afghanistan, under the protection of the Taliban, the Islamists who had been in power since 1996.
When they refused to hand him over, the US intervened militarily, quickly removing the Taliban and vowing to support democracy and eliminate the terrorist threat.
The militants slipped away and later regrouped.
Nato allies had joined the US and a new Afghan government took over in 2004 but deadly Taliban attacks continued. President Barack Obama's "troop surge" in 2009 helped push back the Taliban but it was not long term.
In 2014, at the end of what was the bloodiest year since 2001, Nato's international forces ended their combat mission, leaving responsibility for security to the Afghan army.
That gave the Taliban momentum and they seized more territory.
Peace talks between the US and the Taliban started tentatively, with the Afghan government pretty much uninvolved, and the agreement on a withdrawal came in February 2020 in Qatar.
The US-Taliban deal did not stop the Taliban attacks - they switched their focus instead to Afghan security forces and civilians, and targeted assassinations. Their areas of control grew.
Who are the Taliban?
They emerged in the civil war that followed the withdrawal of Soviet troops in 1989, predominantly in the south-west and the Pakistan border areas.
They vowed to fight corruption and improve security, but also followed an austere form of Islam.
By 1998, they had taken control of almost all of the country.
Find out more on the Afghan conflict 2001-2021
They enforced their own hardline version of Sharia, or Islamic law, and introduced brutal punishments. Men were made to grow beards and women had to wear the all-covering burka. TV, music and cinema were banned.
After their overthrow they regrouped in Pakistani border areas.
How costly has the war been?
In terms of lives lost, it is obviously not easy to say exactly. The number of coalition casualties is much better recorded than Taliban and Afghan civilians.
Research by Brown University estimates losses in the Afghan security forces at 69,000. It puts the number of civilians and militants killed at about 51,000 each.
More than 3,500 coalition soldiers have died since 2001 - about two-thirds of them Americans. More than 20,000 US soldiers have been injured.
According to the UN, Afghanistan has the third-largest displaced population in the world.
Since 2012, some five million people have fled and not been able to return home, either displaced within Afghanistan or taking refuge in neighbouring countries.
Brown University research also puts the US spending on the conflict - including military and reconstruction funds in both Afghanistan and Pakistan - at $978bn (£706bn) up to 2020.
What could happen next?
How the Taliban plan to govern Afghanistan remains unclear.
Women face an uncertain future. Taliban spokesman Suhail Shaheen says the group will respect the rights of women and minorities "as per Afghan norms and Islamic values".
The militants had declared an amnesty across Afghanistan and said it wanted women to join its government.
But there are fears over women's freedom to work, to dress as they choose, or even to leave home alone under Taliban rule.
Another major fear is that the country will once again become a training ground for terrorism.
Taliban officials insist that they will fully adhere to the US deal and prevent any group from using Afghan soil as a base for attacks against the US and its allies.
They say they aim only to implement an "Islamic government" and will not pose a threat to any other country.
But many analysts say the Taliban and al-Qaeda are inseparable, with the latter's fighters heavily embedded and engaged in training activity.
It is also important to remember that the Taliban are not a centralised and unified force. Some leaders may want to keep the West muted by not stirring up trouble but hardliners may be reluctant to break links with al-Qaeda.
Just how powerful al-Qaeda is and whether it could now rebuild its global network is also unclear.
Then there is the regional branch of the Islamic State group - ISKP (Khorasan Province) - which the Taliban oppose.
Like al-Qaeda, ISKP has been degraded by the US and Nato but could use the post-withdrawal period to regroup.
Its fighter numbers could be only between a few hundred and 2,000 but it may try to gain footholds in Kazakhstan, Kyrgyzstan and parts of Tajikistan, which could be a serious regional concern.