The Taliban announced its first ceasefire in Afghanistan since the 2001 US 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.
Hours before Saturday's announcement, Taliban militants stormed an Afghan military base in the western province of Herat, killing at least 17 soldiers, officials 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 Islamic State 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."
Afghan defence ministry spokesman Mohammad Radmanish welcomed the Taliban's move.
"We hope this ceasefire continues," he said in an interview with Tolo News.
A Western analyst in Kabul told AFP the ceasefires were a "confidence-building measure" which, if successful, could help pave the way to peace talks.
ALSO READ: Afghanistan bombing kills 12, wounds 33
But others were more cautious, warning that the Taliban and its brutal arm the Haqqani Network could launch attacks on behalf of the Islamic State 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, using the Arabic acronym for Islamic State.
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.
ALSO READ: DPP loses appeal to hold terror suspect
In February Ghani unveiled a plan to open peace talks with the Taliban, including eventually recognising 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.