KABUL, Afghanistan—The CIA is dismantling its frontline Afghan counterterrorist forces in south and east Afghanistan, leaving a security vacuum that U.S. commanders fear the Taliban and al Qaeda will fill—and leaving the Pakistan border open to a possible deluge of fighters and weapons.

“The CIA has started to end the contracts of some of those militias who were working for them,” said Aimal Faizi, spokesman for outgoing Afghan President Hamid Karzai, a longtime critic of the CIA’s Afghan operatives. “Some of them were in very important locations, so we deployed our troops there.”

U.S. and Afghan military commanders tell The Daily Beast that Afghan forces are stretched too thin to replace many of those departing CIA paramilitaries. Thousands more CIA-trained operatives are about to get the boot ahead of what already promises to be a bloody summer fighting season. That could mean spectacular attacks against U.S. and Afghan targets just as the White House is weighing its long-term commitment to Afghanistan. And it could give the now-small al Qaeda movement inside the country more freedom to grow and eventually hatch new plots more than a decade after the invasion meant to wipe out the perpetrators of the Sept. 11th attacks.

Senior U.S. officials said the slow dismantling of the CIA’s forces has also alarmed U.S. lawmakers, who had assumed those forces would remain in the fight against al Qaeda and the Taliban after U.S. troops withdrew.

But CIA officials told lawmakers this past week that with U.S. troops slowly closing bases across the country, the intelligence agency’s footprint also has to shrink. The CIA doesn’t want to face another high-risk situation like Benghazi, Libya, where militants attacked both the U.S. diplomatic outpost and the CIA base. The U.S. ambassador, one of his staff and two CIA employees were killed in that strike.

The Obama administration had wanted to leave up to 10,000 U.S. troops in the country after the December 2014 withdrawal deadline. But the current Afghan president has refused to sign a long-term security agreement, and the Afghan presidential election seems headed for a runoff, meaning it could be months before a new Afghan president takes charge.

So U.S. forces here are rapidly closing outposts, preparing to withdraw to six “enduring” bases that could remain if a security deal goes through before early fall. While the CIA is not affected by the security agreement, it relies on the U.S. military for protection and logistical support—especially at its far-flung bases in south and east Afghanistan. Just months ago, the talk in administration circles was that these paramilitaries would be significantly expanded in the near future. Now, it appears, the opposite is taking place.

The CIA started recruiting and training these Afghan paramilitary groups only months after the intelligence agency first entered the country in 2001 ahead of invading U.S. troops, according to current and former U.S. and Afghan officials. They described the top-secret force in detail on condition of anonymity because they were not authorized to speak publicly. (The CIA declined to comment for this story.)

The elite Afghan teams have built a fearsome reputation for their U.S. special operations-like targeting of terrorist suspects, guided by a handful of CIA paramilitary officers on most missions.

The forces now facing the chopping block are 750 members of the Counterterrorist Pursuit Teams in the Kunar region—home to the elusive Afghan al Qaeda leader Farouq al-Qahtani al-Qatari—and the entire 3,500-strong Khost Protection Force.

The Khost fighters have helped patrol the insurgent-heavy region along the border with Pakistan’s infamous Waziristan province, an area so heavily populated by Taliban, the Haqqani Network, al Qaeda and other militant networks that it’s frequently targeted by CIA drone strikes.

The Khost and Kunar-based units “are instrumental in blocking the Haqqani/al Qaeda mix that are responsible for spectacular attacks,” said one senior U.S. military official. “It’s not clear what will happen to either unit; there is no plan so far to absorb them.”

Khost province is also the site of one of the worst losses in CIA history, when an al Qaeda double agent blew himself up at Forward Operating Base Chapman, killing seven CIA employees and injuring six more.

One of the first major CIA-trained units to be disbanded was the 900-man Counterterrorist Pursuit Team in the town of Shkin, in Paktika province next to Khost. A former senior Afghan intelligence official said the men were fired with no notice, given a severance payment, two rifles and told to leave. The soon-vacated site was then overrun by Taliban forces, who had to be driven out roughly a month later by the Afghan army.

Karzai’s spokesman Faizi said the Afghan government had no advance notice of the firings, but later tried to recruit the Shkin forces into the ranks of Afghanistan’s intelligence service, in hopes of keeping them from selling their skills to the Taliban or someone else.

“We tried to hire those militia for the same pay as the CIA,” he said. “But only a 100 or so said yes.”

In Kunar province, the Afghan army commander there is trying to keep history from repeating itself, by moving his troops to fill the key U.S. outpost and its nearby CIA base, before the Americans depart.

“I need to take that position, but I need more troops,” Maj. Gen. Mohammad Zaman Waziri told The Daily Beast through an interpreter, during a visit to the Afghan National Army’s 201st Corps headquarters in eastern Afghanistan.

Two U.S. officials said the CIA-trained paramilitaries at the Kunar base have been told of their imminent firing, and some have already reached out to the Taliban, possibly to reach a peace deal for when they no longer have Americans to pay or protect them.