The rapid withdrawal of U.S. troops has left the agency seeking ways to maintain its intelligence-gathering, war-fighting and counterterrorism operations in the country.

WASHINGTON — The rapid U.S. military withdrawal from Afghanistan is creating intense pressure on the C.I.A. to find new ways to gather intelligence and carry out counterterrorism strikes in the country, but the agency has few good options.

#styln-signup {
max-width: calc(100% – 40px);
width: 600px;
margin: 20px auto;
border-bottom: 1px solid #e2e2e2;
min-height: 50px;
}

#styln-signup.web {
display: none;
}

#styln-signup + .live-blog-post::before {
border-top: unset !important;
}

[data-feedpub-type=”LIVE_BLOG”] #styln-signup,
[data-feedpub-type=”FACT_CHECK”] #styln-signup {
border-bottom: none;
}

The C.I.A., which has been at the heart of the 20-year American presence in Afghanistan, will soon lose bases in the country from where it has run combat missions and drone strikes while closely monitoring the Taliban and other groups such as Al Qaeda and the Islamic State. The agency’s analysts are warning of the ever-growing risks of a Taliban takeover.

United States officials are in last-minute efforts to secure bases close to Afghanistan for future operations. But the complexity of the continuing conflict has led to thorny diplomatic negotiations as the military pushes to have all forces out by early to mid-July, well before President Biden’s deadline of Sept. 11, according to American officials and regional experts.

One focus has been Pakistan. The C.I.A. used a base there for years to launch drone strikes against militants in the country’s western mountains, but was kicked out of the facility in 2011, when U.S. relations with Pakistan unraveled.

Any deal now would have to work around the uncomfortable reality that Pakistan’s government has long supported the Taliban. In discussions between American and Pakistani officials, the Pakistanis have demanded a variety of restrictions in exchange for the use of a base in the country, and they have effectively required that they sign off on any targets that either the C.I.A. or the military would want to hit inside Afghanistan, according to three Americans familiar with the discussions.

Diplomats are also exploring the option of regaining access to bases in former Soviet republics that were used for the Afghanistan war, although they expect that President Vladimir V. Putin of Russia would fiercely oppose this.

Recent C.I.A. and military intelligence reports on Afghanistan have been increasingly pessimistic. They have highlighted gains by the Taliban and other militant groups in the south and east, and warned that Kabul could fall to the Taliban within years and return to becoming a safe haven for militants bent on striking the West, according to several people familiar with the assessments.

As a result, U.S. officials see the need for a long-term intelligence-gathering presence — in addition to military and C.I.A. counterterrorism operations — in Afghanistan long after the deadline that Mr. Biden has set for troops to leave the country. But the scramble for bases illustrates how U.S. officials still lack a long-term plan to address security in a country where they have spent trillions of dollars and lost more than 2,400 troops over nearly two decades.

William J. Burns, the C.I.A. director, has acknowledged the challenge the agency faces. “When the time comes for the U.S. military to withdraw, the U.S. government’s ability to collect and act on threats will diminish,” he told senators in April. “That is simply a fact.”

Mr. Burns made an unannounced visit in recent weeks to Islamabad, Pakistan, to meet with the chief of the Pakistani military and the head of the directorate of Inter-Services Intelligence, the country’s military intelligence agency. Defense Secretary Lloyd J. Austin III has had frequent calls with the Pakistani military chief about getting the country’s help for future U.S. operations in Afghanistan, according to American officials familiar with the conversations.

Mr. Burns did not bring up the base issue during his trip to Pakistan, according to people briefed on the meeting; the visit focused on broader counterterrorism cooperation between the two countries. At least some of Mr. Austin’s discussions have been more direct, according to people briefed on them.

A C.I.A. spokeswoman declined to comment when asked about Mr. Burns’s travel to Pakistan.

William J. Burns, the C.I.A. director, at the Capitol last month. He has made an unannounced visit to Pakistan in recent weeks.
Stefani Reynolds for The New York Times

Two decades of war in Afghanistan have helped transform the spy agency into a paramilitary organization: It carries out hundreds of drone strikes in Afghanistan and Pakistan, trains Afghan commando units and maintains a large presence of C.I.A. officers in a string of bases along the border with Pakistan. At one point during President Barack Obama’s first term, the agency had several hundred officers in Afghanistan, its largest surge of personnel to a country since the Vietnam War.

These operations have come at a cost. Night raids by C.I.A.-trained Afghan units left a trail of abuse that increased support for the Taliban in parts of the country. Occasional errant drone strikes in Pakistan killed civilians and increased pressure on the government in Islamabad to dial back its quiet support for C.I.A. operations.

Douglas London, a former head of C.I.A. counterterrorism operations for Afghanistan and Pakistan, said that the agency was likely to rely on a “stay behind” network of informants in Afghanistan who would collect intelligence on the Taliban, Al Qaeda, the stability of the central government and other topics. But without a large C.I.A. presence in the country, he said, vetting the intelligence would be a challenge.

“When you’re dealing offshore, you’re dealing with middlemen,” said Mr. London, who will soon publish a book, “The Recruiter,” about his C.I.A. experience. “It’s kind of like playing telephone.”

In the short term, the Pentagon is using an aircraft carrier to launch fighter planes in Afghanistan to support the troop withdrawal. But the carrier presence is unlikely to be a long-term solution, and military officials said it would probably redeploy not long after the last U.S. forces leave.

The United States is stationing MQ-9 Reaper drones in the Persian Gulf region, aircraft that can be used by both the Pentagon and the C.I.A. for intelligence collection and strikes.

But some officials are wary of these so-called over the horizon options that would require plane and drones to fly as many as nine hours each way for a mission in Afghanistan, which would make the operations more expensive because they require more drones and fuel, and also riskier because reinforcements needed for commando raids could not arrive swiftly during a crisis.

Isaac Brekken/Getty Images

Pakistan is a longtime patron of the Taliban; it sees the group as a critical proxy force in Afghanistan against other groups that have ties to India. Pakistan’s spy agency provided weapons and training for Taliban fighters for years, as well as protection for the group’s leaders. The government in Islamabad is unlikely to sign off on any U.S. strikes against the Taliban that are launched from a base in Pakistan.

Although some American officials believe Pakistan wants to allow U.S. access to a base as long as it can control how it is used, public opinion in the country has been strongly against any renewed presence by the United States.

Pakistan’s foreign minister, Shah Mehmood Qureshi, told lawmakers last month that the government would not allow the U.S. military to return to the country’s air bases. “Forget the past, but I want to tell the Pakistanis that no U.S. base will be allowed by Prime Minister Imran Khan so long he is in power,” Mr. Qureshi said.

Some American officials said that negotiations with Pakistan had reached an impasse for now. Others have said the option remains on the table and a deal is possible.

The C.I.A. used the Shamsi air base in western Pakistan to carry out hundreds of drone strikes during a surge that began in 2008 and lasted during the early years of the Obama administration. The strikes focused primarily on suspected Qaeda operatives in Pakistan’s mountainous tribal areas, but they also crossed the border into Afghanistan.

Pakistan’s government refused to publicly acknowledge that it was allowing the C.I.A. operations, and in late 2011 it decided to halt the drone operations after a series of high-profile events that fractured relations with the United States. They included the arrest of a C.I.A. contractor in Lahore for a deadly shooting, the secret American commando mission in Pakistan to kill Osama bin Laden and an American-led NATO airstrike on the Afghan border in November 2011 that killed dozens of Pakistani soldiers.

The Americans and the Pakistanis “will want to proceed cautiously” with a new relationship, said Husain Haqqani, a former Pakistani ambassador to the United States who is now a senior fellow at the Hudson Institute. But, he said, Mr. Biden’s announcement of a withdrawal “has the C.I.A. and the Defense Department, as well as Pakistanis, scrambling.”

American diplomats have been exploring options to restore access to bases in Central Asia, including sites in Kyrgyzstan and Uzbekistan that housed American troops and intelligence officers during the war.

Secretary of State Antony J. Blinken spoke this month with his counterpart in Tajikistan, though it is not clear if base access was discussed during the call. Any negotiations with those countries are likely to take considerable time to work out. A State Department spokeswoman would say only that Mr. Blinken was engaging partner countries on how the United States was reorganizing its counterterrorism capabilities.

Kiana Hayeri for The New York Times

Russia has opposed the United States using bases in Central Asia, and that is likely to make any diplomatic effort to secure access to bases for the purposes of military strikes a slow process, according to a senior American official.

While the C.I.A. in particular has long had a pessimistic view of the prospects of stability in Afghanistan, those assessments have been refined in recent weeks as the Taliban has made tactical gains.

While military and intelligence analysts have previously had assessments at odds with one another, they now are in broad agreement that the Afghan government is likely to have trouble holding on to power. They believe the Afghan security forces have been depleted by high casualty rates in recent years. The announcement of the U.S. withdrawal is another psychological blow that could weaken the force.

Intelligence assessments have said that without continued American support, the Afghan National Security Forces will weaken and could possibly collapse. Officials are working to develop options for continuing that support remotely, but the Pentagon has not yet come up with a realistic plan that officials believe will work.

Some current and former officials are skeptical that remote advising or combat operations will succeed. Collecting intelligence becomes far more difficult without a large presence in Afghanistan, said Mick P. Mulroy, a retired C.I.A. officer who served there.

“It doesn’t matter if you can drop ordnance,” he said, “if you don’t know where the target is.”

Eric Schmitt contributed reporting.