The United States invaded Afghanistan in 2001 in the wake of the 11 September attacks by Al-Qaeda, which had sought sanctuary under the Taliban regime.
On 31 August, 2021 —after 20 years of war — the last American troops in the US-led NATO coalition flew out of Afghanistan shortly after midnight Tuesday.
Hours ahead of President Joe Biden’s Tuesday deadline, air force transport planes carried a remaining contingent of troops from Kabul airport. Thousands of troops had spent a harrowing two weeks protecting the airlift of tens of thousands of Afghans, Americans and others seeking to escape a country once again ruled by Taliban.
In announcing the completion of the evacuation and war effort, General Frank McKenzie, head of US Central Command, said the last planes took off from Kabul airport at 3:29 pm Washington time, or one minute before midnight in Kabul.
He said a number of American citizens, likely numbering in “the very low hundreds,” were left behind, and that he believes they will still be able to leave the country.
The following is a chronology of US involvement and major developments in Afghanistan over the past two decades:
2001: 9/11 and 'War on Terror'
President George W Bush launched his "war on terror" in response to the 11 September attacks that killed around 3,000 people with airstrikes on Afghanistan on 7 October, 2001. The Taliban government had sheltered 9/11 mastermind Osama bin Laden and his Al-Qaeda terror group.
In December, 2001, US forces bomb the Tora Bora cave complex in eastern Afghanistan where bin Laden is reported to be hiding, but he slips over the border into Pakistan, where he disappears.
In power since 1996, the Taliban are soon defeated and flee the Afghan capital Kabul on 6 December.
Hamid Karzai is appointed to lead an interim government and NATO begins to deploy its International Security Assistance Force.
2003: Overshadowed by Iraq
American attention is diverted from Afghanistan when US forces invade Iraq in March 2003, to oust dictator Saddam Hussein.
The fragmented Taliban and other Islamist outfits regroup in their strongholds in southern and eastern Afghanistan, from where they travel between their bases in neighbouring Pakistan's tribal areas, and launch an insurgency.
2004: First presidential election
Afghanistan's first election under a new system is held on 9 October, 2004, with an enthusiastic turnout of 70 percent. Karzai wins 55 percent of the vote.
The Taliban regroup in the south and east, as well as across the border in Pakistan, and launch an insurgency.
2006-2008: NATO troops increase presence
With US forces mainly fighting a surge campaign in Iraq, only a much smaller contingent is deployed in Afghanistan. The Taliban launch major advances threatening to recapture swaths of territory, especially in the south.
In response, an enlarged NATO mission brings thousands of more troops, notably British forces, hundreds of whom are killed in intense battles against the Taliban in Helmand province.
According to BBC, the British troops' initial mission is to support reconstruction projects, but they are quickly drawn into combat operations. More than 450 British troops lose their lives in Afghanistan over the course of the conflict.
2008-2011: US reinforcements
As attacks multiply, the US command in 2008 asks for more troops and the first reinforcements are sent.
Karzai is re-elected on 20 August, 2009 in elections that are marred by massive fraud, low turnout and Taliban attacks.
In 2009, then president Barack Obama, who had campaigned on a pledge to end the Afghanistan war, doubles the number of US troops to 68,000. In 2010, it reaches around 100,000.
Osama bin Laden is killed on 2 May, 2011, in a US special forces operation in Pakistan's Abbottabad.
On 22 June, Obama announces the beginning of a troop withdrawal, with the departure by mid-2012 of 33,000 soldiers.
2014: NATO exit
In June 2014, Ashraf Ghani is elected president but voting is marred by violence and a bitter dispute over claims of fraud.
In December, NATO ends its 13-year combat mission, but a number of troops remain to train the Afghan military.
The following year, the Taliban make their greatest military advances since being ousted.
The Islamic State jihadist group also becomes active in the region.
Bloody attacks multiply, notably in Kabul.
2020: US-Taliban deal, disputed election
Ghani is declared victorious for a second term on 18 February, 2020, an announcement rejected by his rival and former minister Abdullah Abdullah, who vows to form his own parallel government.
On 29 February, the Trump administration and the Taliban sign a historic deal in Doha under which all foreign forces would leave Afghanistan by May 2021 provided the insurgents start talks with Kabul and adhere to other security guarantees.
A power-sharing deal ends the bitter Ghani-Abdullah feud in May. Abdullah takes the role of leading the peace negotiations.
Talks begin in September but violence surges and the Taliban are blamed for a wave of targeted killings.
May 2021: Foreign troops withdraw
On 1 May, 2021, the United States and NATO start withdrawing their 9,500 soldiers, of which 2,500 are American.
In May, the Americans withdraw from the Kandahar airbase.
On 2 July, Bagram airbase — Afghanistan's biggest, and the nerve centre of the US-led coalition's operations — is handed over to Afghan forces.
President Joe Biden says that the US troop withdrawal will be completed by 31 August, before the 20th anniversary of the 9/11 attacks.
May-August 2021: Taliban blitz
The insurgents launch lightning attacks across Afghanistan, capturing vast stretches of the hinterland as the final foreign troops begin their withdrawal.
The Taliban capture their first provincial capital, Zaranj in the southwest, on 6 August.
Other major cities fall within days, including Kandahar and Herat — Afghanistan's second-and third-biggest cities respectively.
Most of the north, west and south is under Taliban control by 13 August.
The Pentagon says Kabul does not appear to face an "imminent threat".
August 2021: Fall of Kabul
The insurgents fully encircle the capital on 15 August with the capture of Jalalabad in the east.
It leaves Kabul as the only city under government control.
Diplomatic missions scramble to evacuate officials and local staff who fear reprisals from the Taliban.
Ghani flees the country, reportedly to Tajikistan, and the Taliban enter Kabul, eventually taking position in the presidential palace.
In a statement, Ghani admits the insurgents have "won".
2021: International fears
The UN Security Council says the country must not become a breeding ground for terrorism.
Under growing criticism, President Joe Biden insists he has no regrets, and emphasises that US troops cannot defend a nation whose leaders "gave up and fled".
China becomes the first country to say it is ready to deepen "friendly and cooperative" relations with the Taliban.
It later accuses Washington of "leaving an awful mess".
European Union foreign policy chief Josep Borrell says the bloc will have to talk to the Taliban.
Russian president Vladimir Putin calls on the global community to prevent the "collapse" of Afghanistan following the Taliban takeover.
2021: 'Different' Taliban?
The Taliban tell civil servants in Kabul to resume their duties "without any fear".
At their first news conference since seizing power, Taliban spokesman Zabihullah Mujahid says they will let "women work in accordance with the principles of Islam".
Some girls return to school in Herat.
Taliban co-founder Mullah Abdul Ghani Baradar returns to Afghanistan from Doha, and within hours the group says it will be "different" this time.
It says it will pardon its enemies, and promises that women will not have to wear the all-enveloping burqa.
The International Criminal Court's chief prosecutor, Karim Khan, says reported crimes during the Taliban advance may amount to violations of international law.
2021: Airlift chaos
President Biden calls the emergency evacuation from Kabul's airport one of the most "difficult" airlifts ever.
Pressure builds on Biden to extend his 31 August deadline to complete the rescue missions.
The EU's Borrell says "it's mathematically impossible" for the US and its allies to evacuate their Afghan personnel who, along with their families, number tens of thousands.
Conditions deteriorate, with vast crowds crushed together begging to be let inside the airport.
The Taliban blames the US, which is control of the airport, for the dramatic scenes.
Elsewhere, in the rugged Panjshir Valley north of Kabul, a mixture of anti-Taliban militia fighters and former Afghan security forces form a key holdout pocket.
They say they are prepared for a "long-term conflict", but also seek to negotiate with the Taliban about an inclusive government.
2021: Airport bombing
The Taliban warn any extension to the 31 August deadline would be a "red line", but says Afghans with valid visas will be allowed to leave once the airport reopens for commercial flights.
Biden announces on 24 August that he is sticking to the date, after talks with G7 counterparts.
On 26 August, after a chorus of warnings of a terror threat, a suicide bomb rips through crowds outside the Kabul airport, killing more than 100 people, including 13 US troops.
The Islamic State (IS) group, rivals of the Taliban, claimed responsibility.
The Taliban announces Sunday that their supreme leader Hibatullah Akhundzada will make his first public appearance "soon".
The same day, the US says it carries out an air strike in Kabul on an IS-prepared car bomb. It later emerges they may have struck a wrong target, killing 10 civilians including six children.
On Monday, as the US wraps up its withdrawal, several rockets are fired towards the airport, but the Taliban says they are intercepted by a missile defence system.
2021: The US withdraws
Celebratory gunfire rings out in Kabul in the early hours of 31 August as the Taliban and the US confirm that American forces have withdrawn from Afghanistan.
"Tonight at 12:00 am Afghan time, the remaining American troops left Kabul airport and our country gained full independence," Zabihullah Mujahid, the Taliban's chief spokesman, said in a tweet.
"All praise to Allah."
The human cost of the war
Now, let's examine the toll of the US-led war in Afghanistan by the numbers:
Much of the data below is from Linda Bilmes of Harvard University’s Kennedy School and from the Brown University Costs of War project. Because the United States between 2003 and 2011 fought the Afghanistan and Iraq wars simultaneously, and many American troops served tours in both wars, some figures as noted cover both post-9/11 US wars, as per The Associated Press.
Percentage of US population born since the 2001 attacks plotted by al-Qaida leaders who were sheltering in Afghanistan: Roughly one out of every four.
More than 2,400 US military personnel and nearly 50,000 Afghan civilians died in the 20-year war, in addition to tens of thousands of casualties among US contractors, the Afghan military and national police, insurgents and others, according to the Costs of War Project
American service members killed in Afghanistan: 2,461.
US contractors, through April: 3,846.
Afghan national military and police, through April: 66,000.
Other allied service members, including from other NATO member states, through April: 1,144.
Afghan civilians, through April: 47,245.
Taliban and other opposition fighters, through April: 51,191.
Aid workers, through April: 444.
Journalists, through April: 72.
The Costs of War Project also estimates that 241,000 people have died as a direct result of the war in Afghanistan. These figures do not include deaths caused by disease, loss of access to food, water, infrastructure, and/or other indirect consequences of the war.
The figures for Afghanistan are part of the larger costs of the US post-9/11 wars, which extend to Iraq, Syria, Yemen, Somalia and elsewhere. The numbers are approximations based on the reporting of several data sources.
With inputs from AFP and AP