Afghanistan's Taliban insurgents declared a three-day ceasefire for Eid starting on Sunday.
The ceasefire on Saturday comes after weeks of intensified attacks on government forces despite a peace deal agreed with the United States in February.
"The leadership instructs all the mujahideen of the Islamic Emirate to take special measures for security for the countrymen, and conduct no offensive operation against the enemy anywhere," Taliban spokesman Zabihullah Mujahid said in a statement posted on social media.
Afghanistan's President Ashraf Ghani accepted the truce and said on social media that he had ordered the Afghan National Defence and Security Forces (ANDSF) to comply.
"I welcome the ceasefire announcement by the Taliban. The Afghan government extends the offer of peace. As Commander in Chief I have instructed ANDSF to comply with the three-days truce and to defend only if attacked. Further details will be given in my speech tomorrow morning," he wrote on Twitter.
The Taliban statement also instructed its fighters to refrain from entering government areas and also said that Kabul forces were not allowed to enter territories under their control.
The announcement came as a surprise as the Taliban last month rejected a government call for a ceasefire across Afghanistan for the holy month of Ramadan, saying a truce was "not rational".
Since the US invasion in 2001 there has only been one other pause in the fighting – a surprise three-day ceasefire between the Taliban and Kabul marking Eid Al Fitr in 2018.
During the brief lull in fighting, Afghans responded joyfully, with Taliban fighters, security forces and civilians hugging, sharing ice creams and posing for selfies in previously unimaginable scenes.
Saturday's announcement comes just days after the Taliban's leader Haibatullah Akhundzada urged Washington "not to waste" the opportunity offered by the deal the militants signed with the United States that set the stage for the withdrawal of foreign troops from the country.
The US military in Afghanistan welcomed the cease-fire announcement saying "we reiterate our call for the militaries of all sides to reduce violence to allow the peace process to take hold."
The US-Taliban deal signed on February 29 is also aimed at paving the way for the insurgents to hold direct peace talks with Kabul.
"The Islamic Emirate is committed to the agreement... and urges the other side to honour its own commitments and not allow this critical opportunity to go to waste," Akhundzada said in a statement, using the Taliban's name for Afghanistan.
Analysts however say the Taliban have been emboldened by the deal with the US, and Afghan government officials have reported more than 3,800 attacks since it was signed , killing 420 civilians and wounding 906.