The US military announced it has completed its withdrawal from Afghanistan after 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 to mark the moment, which 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 servicemembers dead in a suicide bombing last week.
That attack -- claimed by the Islamic State's Afghan offshoot -- gave edgy urgency to the final days of the US-led effort to allow those seeking to flee Taliban rule out of the country.
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.
"I'm here to announce the completion of our withdrawal to Afghanistan and the end of the military mission to evacuate American citizens," US General Kenneth McKenzie told reporters Monday.
The final flight left at 1929 GMT Monday - just before the start of Tuesday in Kabul, he said.
The return to power a fortnight ago of the Taliban movement, which was toppled in 2001 when the United States invaded in retaliation for the September 11 attacks, triggered a massive exodus of people who fear a new version of hardline Islamist rule.
The evacuation flights have taken more than 123,000 people out of Kabul airport, according to McKenzie.
The regional Islamic State-Khorasan (IS-K) group, rivals of the Taliban, posed the biggest threat to the withdrawal, after carrying out a suicide bombing outside the airport last week that claimed more than 100 lives, including those of 13 US troops.
On Monday, they claimed to have fired six rockets at the airport. A Taliban official said the attack was intercepted by the airport's missile defence systems.
Before the US withdrawal was confirmed, the UN Security Council adopted a resolution requiring the Taliban to honor their commitment to let people freely leave Afghanistan in the days ahead, and to grant access to the UN and other aid agencies, but did not create a "safe zone" in Kabul.
- 'We can't sleep' -
On Monday, the White House confirmed the evacuation effort had been targeted by a rocket attack directed at the airport, but said airlift operations there were "uninterrupted".
An AFP photographer saw a destroyed car with a launcher system still visible in the back seat.
While there were no reports of fatalities or airport damage from the apparent IS-K rocket salvo, they caused greater anxiety for locals already traumatised by years of war.
"Since the Americans have taken control of the airport, we can't sleep properly," Abdullah, who lives near the airport and gave only one name, told AFP.
"It is either gunfire, rockets, sirens or sounds of huge planes that disturb us. And now that they are being directly targeted, it can put our lives in danger."
An AFP journalist in Kabul said there was a constant sound of planes overhead all day Monday, with aircraft taking off and landing, as well as jets offering surveillance and protection.
- 'Potential loss of innocent life' -
The United States said Sunday it had carried out a drone strike against a vehicle threatening the Kabul airport that had been linked to the regional Islamic State chapter -- its second targeting IS-K in recent days.
But on Monday, it looked like they had possibly made a terrible mistake.
Members of one family told AFP they believed a fatal error had been made, and that 10 civilians were killed.
"My brother and his four children were killed. I lost my small daughter.. nephews and nieces," Aimal Ahmadi told AFP.
"We are aware of reports of civilian casualties following our strike on a vehicle in Kabul today," Captain Bill Urban, a US Central Command spokesman, said in a statement.
"We would be deeply saddened by any potential loss of innocent life."
In recent years, the Islamic State's Afghanistan-Pakistan chapter has been responsible for some of the deadliest attacks in those countries.
They have massacred civilians at mosques, public squares, schools, and even hospitals.
While both the Islamic State and the Taliban are hardline Sunni Islamists, they are at times also bitter foes -- with each claiming to be the true flag-bearers of jihad.
Last week's suicide bombing at the airport was one of the deadliest bombings for civilians in Kabul in recent years, and led to the worst single-day death toll for the US military in Afghanistan since 2011.
The IS threat has forced the US military and the Taliban to cooperate in ensuring security at the airport in a way unthinkable just weeks ago.
- Taliban leader -
The Taliban have promised a softer brand of rule compared with their first stint in power, which the US military ended because the group gave sanctuary to Al-Qaeda.
But many Afghans fear a repeat of the Taliban's brutal interpretation of Islamic law, as well as violent retribution for working with foreign militaries, Western missions or the previous US-backed government.
On Sunday, the Taliban revealed their supreme leader Hibatullah Akhundzada was in southern Afghanistan and planning to make a public appearance.
"He is present in Kandahar," said Taliban spokesman Zabihullah Mujahid, referring to the movement's spiritual birthplace.