Fighters from the militant Islamist group were ordered not to carry out “offensive operations” against government forces in a message posted on social media on Saturday night.
It was quickly followed by an announcement by Afghan president Ashraf Ghani that the government “extends the offer of peace”.
Both sides said they would only take action to defend themselves if attacked. The Taliban also warned its fighters not to socialise with Afghan national security forces during the celebrations.
Last month the Taliban had rejected a government call for a ceasefire during Ramadan, arguing a truce was “not rational” as they ramped up attacks on Afghan forces.
At least 146 civilians have been killed and 430 wounded by the Taliban during Ramadan, according to the intelligence and security office in Kabul.
However, a few days ago the group’s leader Haibatullah Akhundzada said the Taliban was committed to the peace deal and urged the US not to “waste” the agreement signed earlier this year.
The ceasefire also follows a recent visit by US peace envoy Zalmay Khalilzad, who urged the Taliban and the Afghan government to continue negotiations.
Zabihullah Mujahid, a Taliban spokesman, said the ceasefire had been declared solely for Eid festivities. He tweeted: “Do not carry out any offensive operations against the enemy anywhere, if any action is taken against you by the enemy, defend yourself.”
Afghanistan’s president Ashraf Ghani replied: “As Commander-in-Chief I have instructed ANDSF (Afghan National Defense and Security Forces) to comply with the three-days truce and to defend only if attacked.”
The US military in Afghanistan welcomed the cease-fire announcement and said: “We reiterate our call for the militaries of all sides to reduce violence to allow the peace process to take hold.”
All US and Nato troops are due to withdraw from Afghanistan by the end of next year under the terms of the peace deal with the Taliban, two decades after 9/11 precipitated the American-led invasion.
Additional reporting by agencies