BAGRAM, Afghanistan — Six years ago, Faiqullah Tajik helped sort laundry at Bagram Air Base, the largest American military outpost in Afghanistan. Mr. Tajik made $600 a month. He liked his job.
Mr. Tajik, 25, was laid off in 2011, as were thousands of other local residents of the nearby town of Bagram, as American forces started to withdraw from the country. Now he runs a shop adjacent to the main gate, selling American refuse from the sprawling facility: a discarded treadmill, used jugs, broken printers and computer fans. He makes $60 a month now, at least sometimes, he said.
“If the Americans leave, I will close my shop,” Mr. Tajik said. “And I will leave.” Since Mr. Tajik relies on the six-square-mile base for his livelihood, the Taliban will kill him if they return, he said.
The town’s location — straddling an important airfield that over the past 40 years has been occupied by two superpowers, the Soviet Union and the United States — has long kept Bagram in a sort of purgatory. The town depends on the base for its economy and also supplies it with a local work force, making it a prime target for the Taliban.
With the Trump administration again engaged in peace talks with the Taliban that are likely to lead to a troop withdrawal, Mr. Tajik and the 80,000 residents of Bagram feel especially vulnerable to the geopolitical maneuverings of the United States and the fate of a war in its 19th year.
“The harm of the base now is not worth it being there,” said Abdul Shokoor, the district governor of Bagram, pointing at the continuously deteriorating security in the district. “And people are not happy with the economic consequences.”
With a line of snow-capped mountains as its backdrop, Bagram airfield was built in the 1950s. It became a vital military hub during the Soviet Union’s 10-year occupation of Afghanistan. After the Soviets finished withdrawing in 1989, the Taliban and Northern Alliance fighters fought for the base, sometimes with their trenches at either end.
After the American invasion in 2001, the base ballooned into a small suburb. Engineers added another runway, permanent barracks and a Pizza Hut; at one point, tens of thousands of civilians and soldiers lived within the base’s growing sprawl.
The base’s size at the height of the war, when more than 100,000 American troops were in Afghanistan, meant that 80 percent of the town of Bagram’s economy relied on it, Mr. Shokoor said. Bagram is the seat of Bagram District, one of 10 districts in surrounding Parwan Province. The modest town is just west of the base in a network of tan-walled compounds surrounded by green grape vineyards.
More than 3,000 Afghan workers like Mr. Tajik once lived in the town, commuting each day to within the barbed-wire confines of the base. The line at the gate, Mr. Tajik said, held more than 1,000 people some mornings. Now, when he arrives at his shop at sunrise, treading across steel pallets left over from the Soviet occupation, just six or seven employees wait to enter.
Bagram started becoming an island unto itself in 2014, when American forces euphemistically ended combat operations and reduced the number of troops in Afghanistan. Because of security concerns on the base, and the town’s shrinking population, many of the local workers have been replaced by foreign contractors.
A “wall” went up between the base and its surrounding community, Mr. Shokoor said. Before, American soldiers would often leave the gates and visit local leaders, listening to residents’ complaints and requests, Mr. Shokoor said. Now, it is just miles of cement walls and guard towers, accompanied by the constant whine of aircraft, occasional rocket attack and roadside bombs.
Attacks have become more frequent. In one of the worst, in November 2016, a suicide bomber sneaked onto Bagram Air Base hidden among a group of workers reporting for duty. The blast killed four Americans and wounded more than a dozen others.
The latest was a Taliban bombing that led to a 12-hour firefight at the base on Dec. 11, in which at least two civilians were killed and dozens were wounded.
Without the well-paying and steady jobs from the base, people started spending less in the bakeries and surrounding shops in Bagram. Those, too, slowly closed or moved. The economic downturn, also acutely felt in nearby Kabul, the country’s capital, has forced residents to relocate elsewhere in Afghanistan, return to farming, turn to the Taliban or, in increasing numbers, try to leave the country altogether.
Nowhere has the base’s declining stature in the community been more acute than in the dozens of scrapyards that ring its borders. The mile-long stretch of vendors who buy wood and refuse from base contractors has been an ever-changing ecosystem.
Sayeed Jamal Nasari started his scrapyard with his father 17 years ago, back when the air base was a cluster of makeshift tents and a small number of American soldiers hunting Al Qaeda in the Hindu Kush. His family employed 100 workers, he said, while the base grew. On some days they would offload 15 trucks’ worth of damaged equipment, piping and wood from used pallets and ammunition crates. Detritus from the American war effort was then growing so fast there was not enough space to burn, bury or destroy all of it at once.
His scrapyard proudly displays relics of the American military industrial complex. Humvee lights built in Aurora, Ill., a damaged running machine made in Plymouth, Mich., and the hull of a decrepit front-end loader from West Fargo, N.D., all lay among piles of debris that have leaked off the base over the last 18 years.
In the past, hundreds of shops, much like Mr. Tajik’s, would buy from his yard, Mr. Nasari said. Customers would drive the 25 miles from Kabul, often looking for home improvement items. Now there are only dozens of shops left, he said, with one truck a day supplying all of them with trash from the base.
At the height of the war, Mr. Nasari made $3,000 to $4,000 a month, he said. In 2014, when the number of American troops in Afghanistan shrank to roughly 10,000 from 26,000, he made more than $100,000 as excess equipment and trash was jettisoned from their headquarters, he said.
But with fewer American and Western troops in the country, and more advanced trash facilities on the air base, Mr. Nasari’s business has slumped. He has one employee and two dogs that limp among the rubbish and scrap, often resting in the shade of a torn, bleached green military cot.
“If the Americans leave, I will just sit and try and sell everything here,” Mr. Nasari said. “What else do I have to do?”