The US military has completed its withdrawal from Afghanistan to end a brutal 20-year war — one that started and ended with the hardline Islamist Taliban in power, despite billions of dollars spent trying to rebuild the conflict-wracked country. Celebratory gunfire rang out in Kabul in the early hours of Tuesday, and elated senior Taliban officials hailed the event as a watershed moment. The withdrawal came after the fraught final days of a frantic mission to evacuate tens of thousands of Americans and Afghans who had helped the US-led war effort — and which left scores of Afghans and 13 US troops dead in a suicide attack last week. That attack — claimed by the Islamic State’s Afghan offshoot — gave edgy urgency to the risky US-led international airlift from Kabul, and also revealed the possible troubles ahead for Afghanistan as the Taliban move to form a government and actually rule.

The withdrawal came before the end of August 31, the actual deadline set by President Joe Biden to call time on America’s longest war — one that ultimately claimed the lives of more than 2,400 US servicemembers. “I’m here to announce the completion of our withdrawal from Afghanistan and the end of the military mission to evacuate American citizens,” US General Kenneth McKenzie told reporters Monday Washington time. “Tonight’s withdrawal signifies both the end of the military component of the evacuation but also the end of the nearly 20-year mission that began in Afghanistan shortly after September 11th, 2001.”

The final flight left at 1929 GMT Monday – just before the start of Tuesday in Kabul, he said. Biden said he would address the nation on Tuesday in Washington.