Who are the Taliban?
The Taliban, or "students" in the Pashto language, emerged in the early 1990s in northern Pakistan following the withdrawal of Soviet troops from Afghanistan. It is believed that the predominantly Pashtun movement first appeared in religious seminaries - mostly paid for by money from Saudi Arabia - which preached a hardline form of Sunni Islam.
The promise made by the Taliban - in Pashtun areas straddling Pakistan and Afghanistan - was to restore peace and security and enforce their own austere version of Sharia, or Islamic law, once in power.
From south-western Afghanistan, the Taliban quickly extended their influence. In September 1995 they captured the province of Herat, bordering Iran, and exactly one year later they captured the Afghan capital, Kabul, overthrowing the regime of President Burhanuddin Rabbani - one of the founding fathers of the Afghan mujahideen that resisted the Soviet occupation. By 1998, the Taliban were in control of almost 90% of Afghanistan.
Afghans, weary of the mujahideen's excesses and infighting after the Soviets were driven out, generally welcomed the Taliban when they first appeared on the scene. Their early popularity was largely due to their success in stamping out corruption, curbing lawlessness and making the roads and the areas under their control safe for commerce to flourish.
But the Taliban also introduced or supported punishments in line with their strict interpretation of Sharia law - such as public executions of convicted murderers and adulterers, and amputations for those found guilty of theft. Men were required to grow beards and women had to wear the all-covering burka.
The Taliban also banned television, music and cinema, and disapproved of girls aged 10 and over going to school. They were accused of various human rights and cultural abuses. One notorious example was in 2001, when the Taliban went ahead with the destruction of the famous Bamiyan Buddha statues in central Afghanistan, despite international outrage.
Pakistan has repeatedly denied that it was the architect of the Taliban enterprise, but there is little doubt that many Afghans who initially joined the movement were educated in madrassas (religious schools) in Pakistan.
Pakistan was also one of only three countries, along with Saudi Arabia and the United Arab Emirates (UAE), which recognised the Taliban when they were in power in Afghanistan. It was also the last country to break diplomatic ties with the group.
At one point, the Taliban threatened to destabilise Pakistan from areas they controlled in the north-west. One of the most high-profile and internationally condemned of all Pakistani Taliban attacks took place in October 2012, when schoolgirl Malala Yousafzai was shot on her way home in the town of Mingora.
A major military offensive two years later following the Peshawar school massacre greatly reduced the group's influence in Pakistan though. At least three key figures of the Pakistani Taliban had been killed in US drone strikes in 2013, including the group's leader, Hakimullah Mehsud.
Seizing power
In the year following the US-Taliban peace deal of February 2020 - which was the culmination of a long spell of direct talks - the Taliban appeared to shift their tactics from complex attacks in cities and on military outposts to a wave of targeted assassinations that terrorised Afghan civilians.
The targets - journalists, judges, peace activists, women in positions of power - suggested that the Taliban had not changed their extremist ideology, only their strategy.
Despite grave concerns from Afghan officials over the government's vulnerability to the Taliban without international support, the new US president, Joe Biden, announced in April 2021 that all American forces would leave the country by 11 September - two decades to the day since the felling of the World Trade Center.
Having outlasted a superpower through two decades of war, the Taliban began seizing vast swathes of territory, before once again toppling a government in Kabul in the wake of a foreign power withdrawing.
They swept across Afghanistan in just 10 days, taking their first provincial capital on 6 August . By 15 August, they were at the gates of Kabul.
Their lightning advance prompted tens of thousands of people to flee their homes, many arriving in the Afghan capital, others heading for neighbouring countries.
The Taliban's return to rule brings an end to almost 20 years of a US-led coalition's presence in the country.