The hardline Islamist Taliban celebrated their total return to power on Tuesday with gunfire and diplomacy, after the last US troops flew out of Afghanistan to end two decades of war.

The United States' longest military conflict drew to a close on Monday night when its forces abandoned Kabul airport, where it had overseen a frenzied airlift that saw more than 123,000 people flee.

Celebrations erupted in Kabul as news spread of the US pull out
Celebrations erupted in Kabul as news spread of the US pull out AFP / -

Taliban fighters then quickly swept into the airport and fired weapons into the sky across the city in jubilation -- an astonishing comeback after US forces invaded in 2001, weeks after the September 11 attacks, and toppled them for supporting Al-Qaeda.

"Congratulations to Afghanistan... this victory belongs to us all," Taliban spokesman Zabihullah Mujahid told reporters hours later on the airport runway.

Mujahid said the Taliban's victory was a "lesson for other invaders".

Planes are seen on the tarmac at Kabul airport just before the US announced it had completed its withdrawal from Afghanistan
Planes are seen on the tarmac at Kabul airport just before the US announced it had completed its withdrawal from Afghanistan AFP / -

In Kandahar, the spiritual birthplace of the movement and the country's second-largest city, thousands of celebrating supporters swept onto the streets.

However, many Afghans are terrified of a repeat of the Taliban's initial rule from 1996-2001, which was infamous for their treatment of women and girls, as well as a brutal justice system.

A Taliban fighter investigates a damaged car with what appears to be a damaged launcher in the back, after multiple rockets were fired in Kabul on August 30, 2021
A Taliban fighter investigates a damaged car with what appears to be a damaged launcher in the back, after multiple rockets were fired in Kabul on August 30, 2021 AFP / WAKIL KOHSAR

The group has repeatedly promised a more tolerant brand of governance compared with their first stint in power, and Mujahid persisted with that theme.

"We want to have good relations with the US and the world. We welcome good diplomatic relations with them all," he said.

Mujahid also insisted Taliban security forces would be "gentle and nice".

Profile of key Taliban leaders
Profile of key Taliban leaders AFP / Gal ROMA
The sound of celebratory gunfire is heard across Kabul and fireworks can be seen in the sky early Tuesday after the Pentagon and Taliban separately confirmed that the last US troops had left Afghanistan, ending a 20-year war. [COMPLETES VIDI9LX2RZ_EN]
The sound of celebratory gunfire is heard across Kabul and fireworks can be seen in the sky early Tuesday after the Pentagon and Taliban separately confirmed that the last US troops had left Afghanistan, ending a 20-year war. [COMPLETES VIDI9LX2RZ_EN] AFPTV

The Taliban face a daunting challenge to transform from an insurgent group into a governing power, in a war-ravaged nation dependent on foreign aid.

The United Nations on Tuesday again warned of a looming "humanitarian catastrophe," with food stocks running low because of disruptions caused by conflict as well as a severe drought, and Secretary-General Antonio Guterres pleaded for international aid.

Some Afghans appealed to the Islamist movement to keep its promise of a softer rule.

There are fears for the rights of women under the hardline Taliban Islamist leadership
There are fears for the rights of women under the hardline Taliban Islamist leadership AFP / Hoshang Hashimi

Fawzia Koofi, a rights activist and former negotiator for the ousted government who has twice survived assassination attempts, called on the Taliban via Twitter to include all Afghans as they turn to ruling.

"Taliban, hear us out: we must rebuild together!" she wrote. "This land belongs to all of us."

Other activists struggled to find hope.

A Taliban fighter in Kabul
A Taliban fighter in Kabul AFP / WAKIL KOHSAR

"If I let my thoughts linger on what we have lost, I will lose my mind," Muska Dastageer, who lectured at the American University of Afghanistan, said on Twitter.

The withdrawal came just before the August 31 deadline set by President Joe Biden to end the war -- one that claimed the lives of more than tens of thousands of Afghans and over 2,400 American service members.

The slightly early finish came amid a threat from the regional offshoot of the Islamic State group, rivals of the Taliban, to attack the US forces at the airport.

Thirteen US troops were among more than 100 people killed late last week when an IS suicide bomber attacked the perimeter of the airport, where desperate Afghans had massed in the hope of boarding an evacuation flight.

The US-led airlift began as the Taliban completed an astonishing rout of government forces around the country and took over the capital on August 15.

Their victory came after Biden withdrew nearly all American troops, but then was forced to send back about 6,000 more to conduct the airlift.

Biden was set to address the nation on Tuesday at 1845 GMT in Washington, as his critics continued to savage him for his handling of the withdrawal.

"We can't fight endless wars, but the scope & consequence of Biden's failure here is staggering," Republican Senator Rick Scott said.

All eyes will now turn to how the Taliban handle their first few days with sole authority over the country, with a sharp focus on whether they will allow free departure for those wanting to leave -- including some foreigners.

Secretary of State Antony Blinken said a small number of US citizens remained in the country -- "under 200" but likely closer to just 100 -- and Britain said the number of UK nationals inside was in the "low hundreds."

Many thousands of Afghans who worked with the US-backed government over the years and fear retribution also want to get out.

Western allies have voiced heartbreak in recent days that not all Afghans who wanted to flee could get on the evacuation flights.

On Tuesday, NATO secretary general Jens Stoltenberg said it was essential to keep the airport open, "both to enable humanitarian aid to the Afghan people and also to make sure that we can continue to get people out".

Authorities from several countries have already begun meeting with Taliban leadership, the latest being India.

Talks are ongoing as to who will now run Kabul airport, which German Chancellor Angela Merkel warned was of "existential importance", as a lifeline for aid.