A US soldier protects himself from dust as a US helicopter takes off after a ceremony handing over Bagram prison to Afghan authorities, at the US airbase in Bagram - Reuters

The Taliban have mocked Washington in a statement issued to mark the 11th anniversary of the war in Afghanistan.

The Islamic militant group says the US army and Nato troops are fleeing the country in "humiliation and disgrace" after staying on Afghan soil for more than a decade.

In 2001, in the aftermath of the 9/11 attacks, the US invaded Afghanistan to uproot the Taliban regime and flush out al-Qaida militants. It has now become America's longest war.

As the troops are on the verge of packing their bags, the Taliban said in a statement: "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 statement continued: "And now after 11 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."

Many countries have already started withdrawing their troops, and all Nato troops will be out by the end of 2014.

Although the Taliban was weakened when the US plunged into action in 2001, the militant group has regained considerable ground in Afghanistan, to the consternation of the west.

Western nations have long been haunted by the fear that Afghanistan may once again become a hub for Islamic militant groups following the departure of Nato troops. Experts also fear fresh battles between insurgents and the security forces.

At least 2,000 American soldiers have been killed in the country as insurgent groups have stepped up attacks.

There have been heavy casualties among Afghan soldiers, too, as they assume the duties of their US counterparts.