KABUL — For three extraordinary days this month, the 17-year Afghan conflict took its first formal break, generating a spontaneous outpouring of emotion on all sides and leaving indelible images of Taliban fighters eating at ice cream stands, hugging tearful Afghan soldiers and praying alongside their longtime enemies.

Now, the insurgents have returned to the fight, launching attacks in several provinces after bluntly refusing President Ashraf Ghani’s offer to extend the truce that ended June 17. Yet the success of the brief but bloodless cease-fire is being widely viewed as a watershed in the war — an unscripted moment that has scrambled the calculus on all sides, opened doors for negotiations once thought shut, won support from key outside actors, and made vague dreams of ending the conflict seem more tangible.

For the Trump administration, which strongly embraced the cease-fire and offered for the first time to discuss Taliban concerns about the long-term presence of foreign troops, the truce underscored a critical distinction that U.S. officials have increasingly made between the domestic Taliban conflict and the foreign-backed terrorist threat to Afghanistan and the United States.

During the cease-fire, suicide bombers from the Islamic State militia attacked two celebratory gatherings among Taliban leaders, elders and Afghan officials, killing 30. The deadly message by the foreign-based extremist Sunni militia, which U.S. Special Operations forces are fighting alongside Afghans, set it sharply apart from the local Taliban, which U.S. officials hope will eventually reach a political settlement. 

Trump has just nominated Lt. Gen. Austin S. Miller, a veteran Special Operations commander, to replace Gen. John W. Nicholson as the top U.S. commander in the country. At a Senate confirmation hearing in Washington on June 19, Miller emphasized that the chief reason for U.S. forces to remain in Afghanistan was not to fight the Taliban but to “prevent terror attacks” against the U.S. homeland.

Although the Trump administration has expanded the role of U.S. forces in the war with the Taliban, such as providing air cover to Afghan troops, it has continued the Obama administration’s commitment to an eventual political settlement between the Afghan adversaries, who share religious, cultural and ethnic roots. In contrast, the United States has intensified its efforts to wipe out foreign terrorists, who enjoy almost no local support and represent a threat to global peace. 

Although the Taliban declined Ghani’s offer to extend the truce and, instead, staged a flurry of rural attacks last week that left some 40 security forces dead, both U.S. and Afghan observers said the wider significance of the truce remains promising. They said it showed how eager the populace is for peace, including many Taliban fighters, and they noted that it was strictly observed by Taliban leaders, who had said they might attack foreign troops but refrained from doing so.

“After 17 years, this has raised a whole new list of questions, challenges and opportunities for everyone. We are not sure what it all means yet, but it indicates that change is afoot,” said one U.S. military official here Friday, speaking on the condition of anonymity to discuss the matter freely. “For the first time, we are seeing the will of the Afghan people. If the Taliban want to talk, the momentum is there.”

Some Afghan experts said Taliban leaders still feel they have the upper hand on the battlefield and therefore are in no rush to talk; others said they, too, were surprised by the emotional public embrace that met their fighters after years of combat — even in the war-battered capital, which has endured numerous bloody suicide bombings and other attacks in recent months. 

The insurgents have said nothing publicly since declaring they would not continue the truce, but there are widespread reports of private feelers being extended on both sides, while peace activist groups have embarked on long marches toward Kabul, drawing attention and support. One group walked several hundred miles from southern Helmand province during the truce; another left the Pakistani city of Peshawar on foot this week and is now heading here.

Another positive development, officials and analysts said, was the public and private support of Pakistan for the truce, which followed a flurry of meetings between Afghan and Pakistani officials as well as the killing of a top Pakistani Taliban leader, known as Mullah Fazlullah, in a U.S. drone strike inside Afghanistan. Fazlullah was widely reviled in Pakistan as the alleged mastermind of a terrorist attack on an army school in 2014 that killed 141 students and teachers. 

In the past, Pakistan has given lip service to Afghan peace talks, but Afghan officials have long accused its security establishment of privately supporting the Afghan Taliban, holding their leaders and families hostage across the border, and finding ways to block meaningful dialogue.

This time, although Afghan leaders denied making a direct deal with Pakistan, they reportedly made unusual efforts to secure its support for a truce; they also received a crucial endorsement from Saudi Arabia, an influential ally of Pakistan. With such regional backing, experts here suggested, the domestic success of the truce could create conditions for peace talks that once would have been stymied from abroad.

“When we saw so many Taliban coming into the cities with no clashes at all, I think we were seeing a great compromise involving Pakistan, the Taliban, and the Afghan and foreign forces,” said Waheed Mojda, a political analyst with long-standing ties to the Taliban.

Some analysts said that Washington’s newly stated willingness to participate in talks with the Taliban, and even to discuss the insurgents’oft-repeated demand for foreign troops to leave the country, could be a breakthrough that removes a key obstacle to negotiations. In the past, the United States has insisted that talks be held only among Afghans. 

“We have always said our presence would be based on conditions rather than time,” the U.S. military official here said Friday, referring to a major shift between the Obama and Trump administrations’ approach to the Afghan conflict. “If the conditions change, then we are ready to reassess things.”

Others said the Taliban’s agenda of creating a pure Islamic state remains a second and more in­trac­table bar to a political settlement, especially as the insurgents have established numerous mini-states across the country, where they reportedly combine efficient public service with religious indoctrination and view themselves as a government in waiting.

But today, a new generation of Taliban fighters has replaced an older one that ruled the country from 1996 to 2001. While they appear to be no less religiously committed, they are more politically attuned, technically sophisticated and eager to win popular support rather than intimidate people. 

“The cease-fire allowed the Taliban to see that the Afghan people are not infidels, and it allowed the people to see that the Taliban are not abnormal,” Mojda said. “If this mind-set keeps going, it can be a good opportunity for all sides in the conflict.”