The Taliban announced its first ceasefire in Afghanistan since the 2001 U.S. invasion on Saturday, with a three-day halt in hostilities against the country's security forces that was greeted with relief by war-weary Afghans.
But the group warned the suspension of fighting for the first three days of Eid, the holiday that caps off Ramadan, did not extend to "foreign occupiers", who would continue to be targeted by the militants.
The unexpected move came two days after the Afghan government's own surprise announcement of a week-long halt to operations against the Taliban.
It is the first time in nearly 17 years of conflict that the militants have declared a ceasefire, albeit a limited one.
"All the mujahideen are directed to stop offensive operations against Afghan forces for the first three days of Eid-al-Fitr," the Taliban said in a WhatsApp message to journalists.
But it added that "if the mujahideen are attacked we will strongly defend (ourselves)."
The Taliban said "foreign occupiers are the exception" to the order sent to its fighters around the country.
"Our operations will continue against them, we will attack them wherever we see them," it said.
Even a brief cessation of hostilities would bring welcome relief to civilians in the war-torn country, where they are paying a disproportionate price in casualties as a result of the conflict.
'Only three days'
In recent years the resurgent militants, along with the Daesh group, have stepped up their attacks on Kabul in particular, making it the deadliest place in the country for civilians.
"Only three days the Taliban are not killing us. The Taliban have won our hearts, if they strike a peace deal with the Afghan government, the Afghans will take them on their shoulders with love," Shah Jahan Siyal, a resident of Nangarhar provincial capital Jalalabad, wrote on Facebook.
Dewa Niazai, a women's rights activist in the same province, posted: "Long live the Taliban! Finally we can breathe a deep sigh of relief on Eid days. I hope these three days of ceasefire turn to a permanent ceasefire."
But analysts were cautious, warning that the Taliban and its brutal arm the Haqqani Network could launch attacks on behalf of the Daesh group, which they are believed to have done previously.
"I don't think the Haqqani Network will be on board (with the ceasefire)," a foreign diplomat in Kabul told AFP.
"I wouldn't be surprised if some incidents happen and are claimed by Daesh," he said.
Afghan political analyst Haroon Mir said it was "too early to be very optimistic".
"We don't know what will happen in the next few days or afterwards," he added.
President Ashraf Ghani on Thursday declared an apparently unilateral week-long ceasefire with the Taliban.
It would last "from the 27th of Ramadan until the fifth day of Eid-al-Fitr," Ghani tweeted from an official account, indicating it could run from June 12-19.
The move came days after a gathering of Afghanistan's top clerics in Kabul called for a ceasefire and issued a fatwa against suicide bombings and attacks.
An hour after the fatwa was issued, a suicide bomber detonated outside the gathering, killing seven people and wounding 20 in an attack claimed by the Daesh group.
In February Ghani unveiled a plan to open peace talks with the Taliban, including eventually recognizing them as a political party. At the time he also called for a ceasefire.
The insurgents did not officially respond, but announced the launch of their annual spring offensive in an apparent rejection of the plan, one of the most comprehensive ever offered by the Afghan government.
Last month, the Pentagon said that senior Taliban officials have been secretly negotiating with Afghan officials on a possible ceasefire.
NATO has led international security efforts in Afghanistan since 2003. It wound down its combat mission in 2014 but its Resolute Support mission comprises almost 16,000 troops from around 40 countries.
The conflict has been at a stalemate for several years, and NATO's best chances of leaving lie in the Taliban agreeing to peace talks and eventually joining the government. The Trump administration has sent additional troops to try to change the course of America's longest war.
On Friday, senior U.S. officials said they will intensify combat against Daesh affiliate in the country during the Kabul government's temporary halt to attacks on the Taliban.
Defense Secretary Jim Mattis said this could, for example, allow the U.S. to partially shift the focus of aerial surveillance from the Taliban to Daesh fighters as well as al-Qaida extremists, who remain a threat 17 years after the U.S. invaded. Mattis spoke to reporters during a break in a NATO defense ministers meeting.
In the meantime, Taliban insurgents have continued to carry out attacks. Just hours before the Taliban's announcement, at least 17 soldiers were killed when their checkpoint came under attack by Taliban fighters in western Herat province, said Gelani Farhad, spokesman for the provincial governor.
Farhad said one soldier was wounded. He added that eight insurgents were killed and more than a dozen others were wounded in the gun battle in Zewal district.
In northern Kunduz province at least 13 local policemen were killed early Saturday when their checkpoint came under an attack by Taliban fighters, said Nematullah Temori, spokesman for the provincial governor.
Temori said that seven others were wounded in Qala-e Zal district. Around 10 insurgents were also killed and nine others wounded during the battle, he said.
Provincial council member Asadullah Sadat told dpa that 23 local policemen were killed as three check posts were stormed in Qala-e-Zal. A dozen other were wounded in the overnight Taliban attack, but the exact figures are not yet clear, Safiullah Amiri, another provincial member, said.
Taliban overran capital Kunduz city on late 2015 for almost 10 days, before they were driven out by Afghan special forces backed by US aircraft.
Taliban currently controls 103 out of a total 107 villages in Qala-e-Zal district, according to both officials.