Final answer:
The U.S. invaded Afghanistan to dismantle al-Qaeda and remove the Taliban from power following the September 11, 2001, terrorist attacks.
Step-by-step explanation:
The United States invaded Afghanistan to fight the Taliban and to dismantle al-Qaeda in response to the terrorist attacks on September 11, 2001. This action, which marked the beginning of the U.S. War on Terror, aimed to topple the Taliban government that harbored al-Qaeda, including its leader Osama bin Laden, who had previously fought against the Soviet occupation alongside Mujahideen forces supported by the U.S. The eventual fall of the Soviet-backed Afghan regime was a consequence of multiple factors, including the resolve of the Afghan people and the intervention of multiple foreign powers, which led to long-lasting instability and the rise of the Taliban.