The former Soviet Union marched into Afghanistan on Christmas Eve, 1979, claiming it was invited by the new Afghan communist leader, Babrak Karmal, and setting the country on a path of 40 years of seemingly endless wars and conflict. After the Soviets left in humiliation, America was the next great power to wade in. Following the September 11, 2001, terrorist attacks, the US invaded to oust the Taliban regime, which had harboured Al Qaeda leader Osama bin Laden. After nearly 20 years, the US ended its war in Afghanistan, withdrawing the last American troops. Left behind was the US-allied government, riven by corruption and divisions, which failed to fend off advancing Taliban insurgents amid stalled peace talks. The Taliban swept into Kabul on August 15 after President Ashraf Ghani fled the country, bringing an end to a two-decade campaign in which the US and its allies had tried to transform Afghanistan.