The Bagram airfield in Afghanistan has been officially handed over to the Afghan defence ministry, a spokesperson told AFP on Friday afternoon.

All US and NATO troops have left the Bagram airbase, a US defence official had earlier been quoted as saying by AFP on Friday morning.

The US has handed back the Bagram airfield to the Afghans after nearly 20 years as part of its plan to withdraw all its forces by this year’s 20th anniversary of the September 11 attacks on the United States.

The vast base, built by the Soviets in the 1980s, is the biggest military facility used by US and NATO forces in Afghanistan, with tens of thousands of troops stationed there during the peak of America’s military involvement in the violence-wracked country.

Also Read | Former US defense secretary Donald Rumsfeld dies at 88

For two decades, Bagram served as the nerve centre for US operations in Afghanistan.

A sprawling mini-city visited by hundreds of thousands of service members and contractors, it boasted swimming pools, cinemas and spas — and even a boardwalk featuring fast-food outlets such as Burger King and Pizza Hut.

It also has a prison that held thousands of Taliban and jihadist inmates over the years.

Bagram was built by the United States for its Afghan ally during the Cold War in the 1950s as a bulwark against the Soviet Union in the north.

Ironically, it became the staging point for the Soviet invasion of the country in 1979, and the Red Army expanded it significantly during their near decade-long occupation.

When Moscow pulled out, it became central to the raging civil war — it was reported that at one point the Taliban controlled one end of the three-kilometre (two-mile) runway and the opposition Northern Alliance the other.

In recent months, Bagram has come under rocket attacks claimed by the jihadist Islamic State.

If the Taliban capture the base, it would be a significant step — perhaps even the decisive one — towards seizing control of Kabul itself.

Also Read | Imran Khan says Pakistan wants ‘even-handed relationship’ with US

After President Joe Biden ordered the departure from Afghanistan in April, the US military had been tasked with removing its 2,500 troops, 16,000 civilian contractors, and hundreds of tons of equipment that were inside Afghanistan by September 11, which marks the 20-year anniversary of the Al-Qaeda attacks on New York and Washington.

The US withdrawal comes despite bloody clashes across the country between the Taliban and Afghan forces.

Washington had already handed over six military bases to Afghan forces before May 1, when it began accelerating the final withdrawal of troops.

Last month it completed the withdrawal from Kandahar Airfield in southern Afghanistan, once the second-largest foreign military base in the country.