The US invaded Afghanistan in 2001 in pursuit of al-Qaida, the jihadist group behind the 9/11 terrorist attacks. The Taliban was ousted from power during the invasion, with the US working with NATO allies to train the Afghan security forces.