The Taliban announced a three-day ceasefire with the Afghan government that will take effect when the Muslim Eid festival begins on Sunday.
After an increase in attacks by the Islamic hardline group against government troops in recent weeks.
President Ashraf Ghani welcomed the announcement and said his soldiers would respect the terms of the truce.
The deal is likely to raise hopes for a reduction in long-term violence in the country.
But a similar ceasefire was announced for Eid in 2018 and has not been extended.
"Do not carry out offensive operations against the enemy anywhere. If any action is taken against you by the enemy, defend yourself," said Taliban spokesman Zabihullah Mujahid on Saturday.
He added that the ceasefire was declared only for the Eid festival, which marks the end of the holy month of Ramadan.
"I welcome the announcement of the ceasefire," wrote Ghani on Twitter shortly afterwards. "I instructed [the military] fulfill the three-day truce and defend only if attacked ".
What is the big picture?
Afghans and international observers hoped to reduce violence between the two sides after the signing of a troop withdrawal agreement between the Taliban and the United States in February.
However, more talk has stopped the exchange of prisoners, and attacks on government forces have increased in recent weeks.
An attack on a motherhood in the capital, Kabul, earlier this month, led to widespread condemnation. Although the Taliban denied involvement, it led President Ghani to order the resumption of offensive operations against them and other groups.
He accused militants of ignoring repeated calls to reduce violence.
Last month, the Taliban rejected a government request for a ceasefire in Afghanistan for Ramadan. They said it was "not rational" and increased attacks on Afghan forces.