Mr. Olson was referring to renewed talks between the United States and Taliban representatives in Doha, Qatar, aimed at negotiating an American military withdrawal and the eventual opening of direct talks between the Afghan government and the insurgency.

Two Western diplomats aware of the peace process said that the United States’ strike against Iran, and Iran’s retaliation in Iraq, will surely slow down the talks, as the Taliban try to grapple with what this means for their insurgency.

While some analysts believe that the elements of the Taliban close to Iran will now feel pressured to deliver on Iran’s behalf, the diplomats said they hoped the Taliban would try to avoid being dragged deeper into another conflict at a time when they were so close to a deal.

During the upheaval of the 1990s, when the Taliban came to power in Afghanistan, the Shiite theocracy in Iran saw the group as an enemy force that oppressed Afghan Shiites and was hostile to Iran.

But while the United States was spending hundreds of billions of dollars in Afghanistan, and cycling nearly a million American troops through in the 18 years of war, Iran changed its policy, deciding to nurture the Taliban when it was useful. General Suleimani was central to that effort, according to United States and Afghan officials, which has given Iran a hedge against the United States in Afghanistan at very little cost.

Those officials say that in some cases, Iran has simply given Taliban leaders and their family members a refuge from American and Afghan forces, hosting them in Iran. One Afghan official said that General Suleimani made a point of allowing the smuggling networks that help finance the Taliban to pass unimpeded through Iran.

In other cases, Iranian support for the insurgency has been more significant. Afghan and Western officials say they know of Taliban offices in several Iranian cities. And the Taliban’s former supreme leader, Mullah Akhtar Mohammad Mansour, had started making trips to Iran from his base in Pakistan. He was returning from one of those trips when a United States drone strike killed him in 2016.