Follow the latest Afghanistan updates
The Pentagon completed its evacuation mission from Kabul airport late on Monday, bringing to an abrupt end to its two-decade military intervention in Afghanistan and leaving the country once more in the hands of the Taliban.
Less than two weeks before the 20th anniversary of the September 11 attacks that triggered the invasion to topple the Taliban and root out Al Qaeda, the last American C-17 cargo plane roared into the night skies above Kabul, where Taliban celebratory gunfire erupted on the ground soon after.
“I’m here to announce the completion of our withdrawal from Afghanistan and the end of the military mission to evacuate American citizens, third-country nationals and vulnerable Afghans,” Gen Kenneth McKenzie, head of US Central Command, said on Monday afternoon in the US.
“Every single US service member is now out of Afghanistan. I can say that with 100 per cent certainty."
Thousands of Afghans, however, were left stranded at Kabul's airport, many of them fearing Taliban reprisals for working with western forces over the past 20 years.
US President Joe Biden said in a statement he would speak about Afghanistan on Tuesday. He thanked the US troops involved in the frantic evacuation of the past fortnight.
"They have done it with unmatched courage, professionalism, and resolve. Now, our 20-year military presence in Afghanistan has ended," Mr Biden said.
Secretary of State Antony Blinken said the end of the war "demands reflection."
"The war in Afghanistan was a 20-year endeavour. We must learn its lessons and allow those lessons to shape how we think about fundamental questions of national security and foreign policy," he said in a televised address.
He added that US efforts in Afghanistan would now pivot to diplomacy, although the US embassy in Kabul is shut and its services transferred to Doha.
The longest war in American history ended with astonishing speed as a demoralised and ill-supported Afghan military collapsed against a stunning Taliban advance across Afghanistan this month.
US assurances that the western-trained Afghan police and military forces could stand up to the Taliban evaporated as the hardliners took city after city, often with little resistance.
The entrenched corruption at the heart of the military and President Ashraf Ghani's government had left frontline Afghan troops without ammunition, pay, reliable backup – and sometimes even food. Without American air support and encouragement, years of training efforts were all for naught.
After the Taliban seized Kabul on August 15, the final act of the war played out at the airport, where tens of thousands of Afghans and other nationals rushed to leave on military evacuation flights.
In all, more than 123,000 people managed to flee since August 14. But scores were killed at the airport, mostly in a suicide bombing last week.
Several also plunged to their deaths after trying to cling on to the side of a US plane leaving the runway.
Thirteen US troops were killed in the bombing, the final Americans to die in the war that Gen McKenzie said had claimed 2,461 American lives. More than 1,000 allied troops also died in the 20-year war.
While the US presence in Afghanistan is over, Pentagon officials have stressed the US retains "over-the-horizon" military capabilities and would continue to strike ISIS targets if necessary.
Gen McKenzie said some 2,000 ISIS fighters are in Afghanistan. Many were released from two prisons in Bagram when the Taliban seized control and turned the inmates loose.
The horrific toll from the war in Afghanistan includes tens of thousands of Afghan civilians, and estimates have put the cost as high as $2 trillion in US spending.
It is unknown how many Taliban fighters were killed. At one point, Pentagon officials bragged of killing about 75 of them most nights.
Ultimately, the war ended much like it started, with the Taliban in power and Al Qaeda looming large.
The rushed departure from Afghanistan meant thousands of Afghans who fear Taliban reprisals for working with western powers are now stuck, their future uncertain.
The Taliban have pledged to moderate some of their hard-line laws and allow women to retain some of the freedoms they enjoyed under a western-backed regime. They have also vowed to allow people to continue to leave Afghanistan, but what happens next is anyone's guess.
"There's a lot of heartbreak associated with this departure. We did not get everybody out that we wanted to get out," Gen McKenzie said, noting that the US charge d'affaires for Kabul, Ross Wilson, was on the final flight.
The emergency evacuations ended in time for the August 31 deadline set by US President Joe Biden, who inherited a troop withdrawal deal made with the Taliban by his predecessor Donald Trump and decided to complete the pullout.
"The sounds of gunfire are like a death sentence to me," Mohammad, one Afghan civil activist who has been threatened by the Taliban, told The National as celebratory Taliban shooting rang out across Kabul early on Tuesday morning.
Mr Mohammad, whose name The National changed to protect his identity, was camped outside the airport for five days, despite the recent attacks, but was not allowed inside.
"I have worked with the Americans, which put my life at risk, and they were my last hope in getting out. They just left me behind," he said, choking back tears.