ISLAMABAD, Pakistan — A first possible breakthrough in the 17-year Afghan conflict came in June, when a brief cease-fire during a Muslim holiday produced a spontaneous celebration by Afghan troops, civilians and Taliban fighters. The nationwide yearning for peace became palpable.

Now, in a development that could build on that extraordinary moment, a senior American diplomat and Taliban insurgent officials have reportedly held talks for the first time, meeting in the Persian Gulf state of Qatar and agreeing to hold further sessions. According to Taliban officials, they discussed reprising the truce in August.

Officials in Washington have not acknowledged the meeting, but the State Department confirmed that its senior official dealing with the Afghan region, Alice Wells, traveled last week to Doha, the Qatari capital, partly to “commend the government” for its “ongoing support for peace in Afghanistan.” Qatar has long hosted a Taliban political office.

“Our view on this [is] if you can get a cease-fire that lasts a few days, perhaps you could get another one that lasts a bit longer, and that gives the people of Afghanistan hope,” State Department spokeswoman Heather Nauert said Monday.

Taliban officials were more expansive. One told journalists that the meeting in a Doha hotel had produced “very positive signals.” He declined to call them peace talks but said the meeting was held to “initiate formal and purposeful talks,” the Reuters news agency reported. “We agreed to meet again soon and resolve the Afghan conflict through dialogue,” the official said.

The meeting was remarkable, notably for who was there and who was not. The Taliban said there were no officials or representatives from the Afghan government, which has always publicly taken the lead in peace initiatives with the insurgents.

It was Afghan President Ashraf Ghani who offered a cease-fire in June, at the end of Ramadan, the Muslim holy month, but his previous efforts at holding peace talks since taking office in 2015 have failed. Taliban officials reportedly insisted that no Afghan officials attend the recent meeting.

It was even more extraordinary that the Trump administration pursued a bilateral meeting with the insurgents, a step that amounted to a major concession and indicated how eager U.S. officials are to end the costly war. Taliban leaders have insisted for years that they will negotiate only with the United States, and their major condition for peace is that all foreign forces withdraw.

Until recently, U.S. officials had insisted that all negotiations be “Afghan-owned and Afghan-led,” and the Trump administration’s policy has stressed military efforts — sending a limited number of U.S. troops to train and advise Afghan forces fighting the Taliban, while sending Special Operations forces to wage a joint parallel war against the Islamic State and other foreign terrorist groups.

[]

But as the relentless war continues, causing record civilian casualties and leaving large areas under Taliban control or influence, U.S. officials have expressed increasing frustration and willingness to explore new approaches. Secretary of State Mike Pompeo said several months ago that the administration would be willing to participate in talks with the Taliban, and even discuss the future role of U.S. forces.

The successful cease-fire in June provided an unexpected boost in hopes for reconciliation, and an opening for more direct U.S. engagement with the Taliban. Wells, a deputy assistant secretary of state, visited Kabul, Islamabad and other regional capitals several weeks later, and although she publicly insisted that the current U.S. strategy was working, rumors spread that Washington was holding or planning secret talks with the insurgents.

The motives behind the Taliban’s participation in the talks are less clear. Several analysts said that while the insurgents are doing well on the battlefield and have no immediate incentive to talk, their leaders were impressed by the conciliatory atmosphere of the June truce and may sense a new opportunity to press their demands on U.S. officials.

Still, several Afghan observers with longtime links to the Taliban said the insurgents would probably remain adamant on positions that the U.S. government would not accept, such as imposing sharia law on the country and removing all foreign troops. Even if the Taliban were to join an Afghan government, the U.S. military would likely seek to keep some troops and bases because of the continuing threat from the Islamic State.

One Taliban official told news agencies that the group’s delegation requested free movement in several areas that the insurgents control, and that the U.S. visitors urged a second truce during the Muslim feast of Eid al-Adha, which falls in the third week of August.

Analysts said the Taliban rebels have reasons not to seem too eager to make peace, though, such as fear of losing their hardcore fighters to the region’s more aggressive Islamic State forces , known here by the Arabic acronym Daesh.

“They are scared that if they make a deal with the government, some of their fighters, who have no skills except pulling a trigger, may join Daesh,” said Waheed Mojhdah, an analyst in Kabul who has longtime connections with the Taliban. “Daesh is waiting to invite them.”

Sayed Salahuddin and Sharif Hassan in Kabul contributed to this story.