The United States invasion of Afghanistan occurred after the September 11 attacks in late 2001, supported by close allies. The conflict is also known as the U.S. war in Afghanistan. It followed the Afghan Civil War's 1996–2001 phase. Its public aims were to dismantle al-Qaeda, and to deny it a safe base of operations in Afghanistan by removing the Taliban from power. The United Kingdom was the key ally of the United States, offering support for military action from the start of preparations for the invasion. In August 2003, NATO became involved as an alliance, taking the helm of the International Security Assistance Force.
U.S. President George W. Bush demanded that the Taliban hand over Osama bin Laden and expel al-Qaeda, bin Laden had already been wanted by the U.N. since 1999. The Taliban declined to extradite him unless given what they deemed convincing evidence of his involvement in the 9/11 attacks and ignored demands to shut down terrorist bases and hand over other terrorist suspects apart from bin Laden. The request was dismissed by the U.S. as a meaningless delaying tactic and it launched Operation Enduring Freedom on 7 October 2001 with the United Kingdom. The two were later joined by other forces, including the Northern Alliance. The U.S. and its allies drove the Taliban from power and built military bases near major cities across the country. Most al-Qaeda and Taliban were not captured, escaping to neighboring Pakistan or retreating to rural or remote mountainous regions.
In December 2001, the United Nations Security Council established the International Security Assistance Force (ISAF), to oversee military operations in the country and train Afghan National Security Forces. At the Bonn Conference in December 2001, Hamid Karzai was selected to head the Afghan Interim Administration, which after a 2002 loya jirga in Kabul became the Afghan Transitional Administration. In the popular elections of 2004, Karzai was elected president of the country, now named the Islamic Republic of Afghanistan. In 2003, NATO assumed leadership of ISAF. One portion of U.S. forces in Afghanistan operated under NATO command; the rest remained under direct U.S. command. Taliban leader Mullah Omar reorganized the movement, and in 2003, launched an insurgency against the government and ISAF.