America's longest war entered its 12th year Sunday, with the anniversary marked by a Taliban statement claiming that NATO forces are "fleeing Afghanistan" in "humiliation and disgrace".

The US led the invasion on October 7, 2001 to topple the Taliban government for harbouring Al Qaeda leader Osama bin Laden after the September 11 attacks on New York and Washington.

The Taliban were quickly routed, but launched an insurgency that grew in strength over the years until NATO had some 130,000 troops from 50 countries defending the Western-backed government of President Hamid Karzai.

The troops have now begun pulling out and all foreign combat forces will be gone by the end of 2014 according to a withdrawal schedule agreed by the US and NATO.

"With the help of Allah, the valiant Afghans under the Jihadi leadership of Islamic Emirate defeated the military might and numerous strategies of America and NATO alliance," the Taliban said in a statement Sunday.

"And now after eleven years of unceasing terror, tyranny, crimes and savagery, they are fleeing Afghanistan with such humiliation and disgrace that they are struggling to provide an explanation".

A total of 3,199 NATO soldiers have been killed in the war, more than 2,000 of them Americans. Most deaths occurred in the past five years as Taliban attacks escalated, according to casualties.com.

This year, official statistics showed that deaths in the Afghan security forces are running five times higher than those for NATO, as the Afghans take on increasing responsibilities before the Western withdrawal.

The US and NATO say Afghan forces will be capable of taking over the fight against the Taliban after 2014, but many analysts predict a bloody new multi-factional civil war.