The war in Afghanistan was a prolonged armed conflict lasting from 2001 to 2021. It began with an invasion by a United States–led coalition under the name Operation Enduring Freedom in response to the September 11 attacks carried out by the Taliban-allied and Afghanistan-based al-Qaeda. The Taliban were expelled from major population centers by American-led forces supporting the anti-Taliban Northern Alliance, thus toppling the Taliban-ruled Islamic Emirate. Three years later, the American-sponsored Islamic Republic was established, but by then the Taliban, led by founder Mullah Omar, had reorganized and begun an insurgency against the Afghan government and coalition forces. The conflict ended almost twenty years later as the 2021 Taliban offensive reestablished the Islamic Emirate. It was the longest war in United States military history, surpassing the Vietnam War by six months.
Following the September 11 attacks, masterminded by al-Qaeda leader Osama bin Laden, American president George W. Bush demanded that the Taliban immediately extradite him to the United States and close down al-Qaeda's camps in Afghanistan; the Taliban refused and demanded evidence of bin Laden's guilt before offering to hand him over to a neutral country. The U.S. dismissed these offers and proceeded with the invasion. After expelling the Taliban and their allies, the American-led coalition remained in Afghanistan, forming the International Security Assistance Force (ISAF)—sanctioned by the United Nations—with the goal of creating a new democratic authority in the country that would prevent the Taliban from returning to power. A new Afghan Interim Administration was established, and international rebuilding efforts were launched. By 2003, the Taliban had reorganized and launched a widespread insurgency against the new Afghan government and coalition forces. Insurgents from the Taliban and other Islamist groups waged asymmetric warfare, fighting with guerrilla warfare in the countryside, suicide attacks