The Taliban, whose origin of the word means students (of the Koran), was originally made up of young people of the Pashtun ethnic group - the majority in Afghanistan - trained in the "madrasas" (Koranic schools), soon gained followers by presenting themselves as the guarantors of order and unity in a country that had been plunged for 15 years in an uninterrupted war, following the Soviet occupation between 1979 and 1989, and then a civil war.
Hence their relatively rapid rise. On 27 September 1996, the Taliban entered Kabul, executed Mohammed Najibullah, president of the pro-Soviet government, and in less than two years, in 1998, took control of 90% of the country.
The rest, reduced to a small fiefdom in the north-east of the country, remained in the hands of the Northern Alliance, an inter-ethnic group of "warlords".
Once in power, the Taliban formed a government (recognised only by Saudi Arabia, Pakistan and the United Arab Emirates) and imposed their own laws, characterised by excessive religious puritanism and human rights abuses.
The fundamentalist militia banned women from working outside the home, forced them to wear the burqa and closed girls' schools. Men were forced to grow beards, cinemas were closed, and music, chess and gambling were banned.
The regime also introduced stoning for adulterers, amputation of hands for thieves, flogging for homosexuals and the death penalty for Afghan Muslims who converted to another religion or invited conversion.
Human rights abuses prompted the European Commission, the United Nations and others to urge the regime to respect international conventions, but it was hospitality to the founder and leader of the Al-Qaeda terrorist organisation, Saudi Arabia's Osama bin Laden, that precipitated its demise.
Following the August 1998 bombings of the US embassies in Tanzania and Kenya, the US bombed suspected terrorist bases in Afghanistan and on 15 October 1999, the UN Security Council issued an ultimatum to the regime to extradite bin Laden under threat of an air embargo and financial sanctions, which came into effect a month later.
Resistance to handing over Bin Laden, following the 11 September 2001 attacks in New York and Washington, led in October to armed intervention in Afghanistan and the rapid overthrow of the fundamentalist regime, which in November succumbed to the combined action of US bombing and the offensive of the former "mujahideen".
However, the insurgency against the Kabul government and international forces did not cease, and since the beginning of the invasion in 2001 - replaced by a training mission in 2014 - more than 2,200 US military personnel have died in Afghanistan.
But it was on 29 February 2020 that the end of the US occupation began to take shape in Doha with the signing of a historic agreement between Washington and the Taliban, which provided for the withdrawal of allied troops deployed in Afghanistan - between 12,000 and 13,000 troops - in barely fourteen months, and the release of 5,000 Taliban prisoners and 1,000 members of the Afghan forces.
In return, the Taliban pledged not to allow Afghan soil to again become a sanctuary for foreign terrorist groups seeking to carry out attacks abroad, and agreed to initiate an intra-Afghan peace dialogue.
The peace dialogue, which began in September 2020 in Doha, made little significant progress, stalling for months even on previous steps such as trying to reach common ground on the procedures to be followed during the talks.
The Doha agreement of February 2020 was signed during Donald Trump's administration, and with the new US president, Joe Biden, taking office in January 2021, plans for a full withdrawal of allied troops remained on the table, although their completion was delayed from May to September this year.
It was precisely on 1 May that the final phase of the withdrawal of foreign troops from Afghanistan officially began, a process that coincided with a rapid offensive by the Taliban, who, in an unprecedented advance, conquered a large part of the country with hardly any resistance.
This offensive intensified on 6 August, with the capture of the first of the country's 34 provincial capitals, and little more than a week later, on 15 August, the Taliban entered Kabul bloodlessly, while the Afghan president, Ashraf Ghani, secretly left the country.
Shortly afterwards, with the entire country under their control except for the north-eastern province of Panjshir, which once again became the main anti-insurgency stronghold, the Taliban proclaimed victory in Afghanistan, ending almost 20 years of war.