KANDAHAR, Afghanistan — The Taliban's attacks outside this large provincial capital began this month with little out of the ordinary: sporadic small-arms fire on military outposts. Quickly, though, the gunfire morphed into a barrage of heavy artillery that allowed thousands of Taliban fighters to pour into the district of Arghandab.

Within a matter of days, the district, which had been under government control for a decade, was in Taliban hands.

It was only after a series of punishing U.S. airstrikes that Afghan ground forces were able to retake the territory, Afghan officials said. U.S. air support played a similarly critical role last month in pushing back the militant group in Helmand province, where the Taliban came within yards of breaching the provincial capital’s limits.

The battles come as U.S. forces have begun to close Kandahar Air Field, according to two Afghan officials, as part of an accelerated drawdown of U.S. forces in the country. After the recent weeks of intense fighting, many here fear the reduced troop numbers and base closures could mean less U.S. support for future battles against an emboldened Taliban.

The U.S. airstrikes were “the only reason the Taliban was pushed back,” said Lt. Col. Niaz Mahmad Majahad, the national police commander in Arghandab whose forces fought the Taliban until the military arrived. “If it weren’t for the airstrikes, the Taliban would not have fallen.”

Over the next two months, the number of U.S. forces in Afghanistan will be cut in half, from around 5,000 to 2,500, acting defense secretary Christopher C. Miller announced from the Pentagon on Tuesday. That level will mark the lowest number of U.S. troops on the ground in the conflict since 2002. 

It was a move Miller’s predecessor warned against in a classified memo days before he was fired. Former defense secretary Mark T. Esper cited ongoing violence in Afghanistan and apprehension about undercutting negotiations between the Afghan government and the Taliban among his concerns about a more rapid withdrawal.

On Saturday, Secretary of State Mike Pompeo stopped in Doha during a Middle East trip in an effort to revive stalled talks between the Taliban and Afghan government. Pompeo reiterated previous U.S. statements, calling for “a significant reduction in violence,” but no immediate announcements of progress followed.

A U.S. defense official, speaking on the condition of anonymity because of the sensitivity of the issue, said a small number of U.S. service members are at Kandahar Air Field as the drawdown continues. Many of them are preparing equipment to be sent out of the country as the Jan. 15 drawdown deadline looms, he said.

The U.S. military command in Afghanistan did not comment on airstrikes against the Taliban in Helmand and Kandahar or on the status of Kandahar Air Field.

Kandahar Air Field, which Afghan officials say provided support for the airstrikes last week, was once the largest NATO base in Afghanistan, home to what U.S. troops called the “boardwalk,” a collection of stores, restaurants and U.S. fast-food chains such as KFC and TGI Fridays.

Gul Ahmad Kamin, 34, a member of parliament from Kandahar, said U.S. forces have been slowly closing the airfield for months and were just one week away from shuttering the base when Taliban fighters attacked nearby Lashkar Gah, Helmand’s provincial capital. A senior Afghan official who spoke on the condition of anonymity to discuss the matter confirmed that U.S. forces have closed parts of the base.

An Afghan employee of a private security company located near U.S. compounds on the base said he noticed movement to close the base about a month and a half ago, when several large shipping containers were handed over to the Afghan military, surveillance balloons were reeled in and deflated, and U.S. troops began selling off their civilian vehicles to private contractors. He spoke on the condition of anonymity because his employer did not authorize him to speak to the media.

Throughout the weeks-long Taliban offensive in southern Afghanistan, the massive cargo planes continued their runs to and from Kandahar Air Field, he said.

For Afghan government forces stationed in and around Kandahar, the presence of U.S. troops is as much about symbolism as it is about the technical support they can provide, Kamin said.

“It’s all about morale,” he said. “When U.S. forces are increasing, the morale is higher. When they are decreasing, the morale suffers.”

In many parts of Afghanistan, as U.S. troops have drawn down, insecurity and higher levels of violence have followed. And although the public text of the U.S.-Taliban deal does not call for a reduction in violence, U.S. officials have said Taliban attacks on cities and towns under Afghan government control are “not consistent” with the agreement.

Abdul Nafi Pashtun, commander of Afghanistan’s 04 paramilitary unit, said the Taliban’s assault on Arghandab is another breach of the deal.

“Their plan was to enter Kandahar city,” he said. Established primarily to conduct night raids and other small, targeted operations, Pashtun’s unit has been marshaled to fight on the front lines over the past seven months as Taliban attacks have intensified and regular Afghan units with less U.S. support have proved unable to protect territory under government control.

He and his commandos were called in to support other Afghan forces as they struggled to retake Arghandab earlier this month. The district, considered the gateway to Kandahar city, sits on its northwestern edge along one of three main roads that connect the city to the rest of Afghanistan.

Majahad, the national police commander in Arghandab, said, shaking his head, that an estimated 3,500 Taliban fighters launched the first assault on his district and “had 500 motorbikes with them.”

In three decades of military service, he said, he never saw a Taliban assault of such magnitude. “There is no doubt they are stronger and more well equipped now,” he said. “And with this news [of faster U.S. troop withdrawals], the Taliban gets a great advantage.”

Fatima, a widow in her 60s from Arghandab who like many Afghans goes by a single name, fled to Kandahar city more than two weeks ago with three small children.

“There were bullets everywhere,” she said. “This war is the worst I have seen since the Soviet time.”

Saki Jana fled with her family from Panjawai district west of Kandahar, where intense clashes with the Taliban are ongoing. She also said the number of Taliban fighters was far greater in this attack than in previous assaults.

“They were just everywhere, on every street. They only ran to hide when you could hear a helicopter coming,” she said.

Without the fear of U.S. air and drone strikes since the signing of the February deal, the Taliban can more easily move fighters and equipment around the country, Majahad said. And the militants can also gather openly in larger groups, as they did in the days and weeks leading up to the offensives in Helmand and Kandahar.

“I don’t think we will ever be able to go back,” Fatima said. While Afghan government forces have retaken most of her district, she said she doesn’t trust that they won’t abandon their posts the next time the Taliban launches an assault.

“The Americans are leaving, the Taliban are increasing their attacks, and we are stuck in between,” she said. “This country is just being destroyed.”

Correction: An earlier version of this article incorrectly referred to the U.S. military command in Afghanistan as Resolute Support, which is the U.S.-led NATO mission there. The U.S. military command is called U.S. Forces-Afghanistan.

Aziz Tassal in Kandahar and Dan Lamothe in Washington contributed to this report.