For decades Bagram Air Base, north of the Afghan capital, served as both the linchpin for foreign armies fighting insurgents and as a symbol of the brutalities unleashed by years of civil war.

Just 50 kilometres (30 miles) from Kabul, the base is vital to the security of the capital while also providing strategic cover to much of the country’s rugged north.

The sprawling airfield was first built by the Americans for its Afghan ally during the Cold War in the 1950s as a bulwark against the Soviet Union in the north.

Also Read | All US and NATO troops leave Bagram airbase in Afghanistan: Official

Since its construction, a rotating cast of characters has exchanged control of the base, during decades of conflict that have roiled Afghanistan.

It served as the staging ground for the Soviet occupation of Afghanistan following the Red Army’s invasion in 1979, and Moscow vastly expanded it.

Following the Soviet withdrawal nearly a decade later, the base went from being controlled by the Moscow-backed government to being occupied by the shaky mujahideen administration during the 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.

Bagram ultimately fell into the Taliban’s hands after the hardline jihadist group overran large swathes of the country in the mid-1990s.

Following the September 11 attacks and the US invasion of Afghanistan, the Americans took control of the base.

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

Washington’s long war against the Taliban and their Al Qaeda allies was largely maintained with air strikes and resupply missions stemming from the airfield.

The past two decades have brought numerous US presidential visits, while the base was also home to a prison that stoked controversy over the treatment of Afghan detainees by foreign forces.

During its heyday, the mini-city was 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.

In recent months, Bagram has come under rocket barrages claimed by the jihadist Islamic State, sparking new fears that militants are already eyeing the base for future attacks.

Following months of consultations, US President Joe Biden in April announced he would end the country’s longest war and bring home its remaining troops ahead of the 20th anniversary of the September 11 attacks.

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

To this day, the sides of the road from Kabul to Bagram remain littered with the rusting hulks of old Soviet tanks — a searing reminder of the more than four decades of conflict that has left much of Afghanistan in tatters.