The Taliban declared Wednesday a national holiday and lit up the capital with coloured lights to celebrate the first anniversary of the withdrawal of US-led troops from Afghanistan after a brutal 20-year war.

The country's new rulers -- not formally recognised by any other nation -- have reimposed their harsh version of Islamic law on the impoverished country, with women squeezed out of public life.

But despite the restrictions, and a deepening humanitarian crisis, many Afghans say they are glad the foreign force that prompted the Taliban insurgency has gone.

"We are happy that Allah got rid of the infidels from our country, and the Islamic Emirate has been established," said Zalmai, a resident of Kabul.

The withdrawal of troops at midnight as August 31 began last year ended America's longest war -- a military intervention that began in the wake of the September 11, 2001 attacks in New York.

Some 66,000 Afghan troops and 48,000 civilians were killed in the conflict, but it was the deaths of US service members -- 2,461 in total -- that became too much for the American public to bear.

More than 3,500 troops from other NATO countries were also killed.

"The burden of the war in Afghanistan, however, went beyond Americans," the US military said Tuesday.

Two weeks before the end of last year's withdrawal, the Taliban seized power following a lightning offensive against government forces.

Banners celebrating victories against three empires -- the former Soviet Union and Britain also lost wars in Afghanistan -- were flying in Kabul on Wednesday.

Hundreds of white Taliban flags bearing the Islamic proclamation of faith flew from lamposts and government buildings.

Late Tuesday, the skies above Kabul were lit up with fireworks and celebratory gunfire from crowds of Taliban fighters.

In Massoud Square, near the former US embassy, armed fighters carrying Taliban flags chanted "Death to America". Others drove across the city honking their horns.

Taliban social media accounts posted scores of videos and pictures of newly trained troops -- many flaunting the US military equipment left behind in the haste of Washington's chaotic withdrawal.

"This is how you troll a superpower after humiliating them and forcing them to withdraw from your country," read the caption of one post on Twitter featuring a photo of a giant Taliban flag now painted on the wall of the former US embassy.

Despite the Taliban's pride in taking over, Afghanistan's 38 million people now face a desperate humanitarian crisis -- aggravated after billions of dollars in assets were frozen and foreign aid dried up.

Hardships for ordinary Afghans, especially women, have increased.

The Taliban have shut secondary girls' schools in many provinces and barred women from many government jobs.

They have also ordered women to fully cover up in public -- ideally with an all-encompassing burqa.

"Now I'm sitting at home without a job," said Oranoos Omerzai, a resident of Kandahar, the de facto power centre of the Taliban.

Government spokesman Zabihullah Mujahid insisted "major achievements" had been recorded in the past year.

"Afghans are no more being killed in war, foreign forces have withdrawn, and security has improved," he told reporters last week.