Disagreements over a prisoner exchange and the violence have delayed peace talks between an Afghan government-mandated committee and the Taliban, as envisaged in an agreement signed between the United States and the militant group in Doha in February.
"In order for our people to spend the three days of Eid in confidence and happiness, all fighters are instructed not to carry out any operations," Taliban spokesman Zabihullah Mujahid tweeted.
However, he added that if Taliban fighters come under attack from government forces, they will retaliate.
The Afghan president's spokesman, Sediq Sediqqi, said the government welcomed the ceasefire announcement but added that Afghans wanted enduring peace and the start of direct peace negotiations.
Since the US-Taliban agreement, 3,560 Afghan security forces personnel have been killed in attacks by militants, President Ashraf Ghani said in a speech on Tuesday.
The UN Assistance Mission in Afghanistan (UNAMA) said in a report on Monday that more than 1,280 Afghan civilians had been killed in the first six months of the year, mainly as a result of fighting between Afghan government forces and the Taliban.The US State Department said last week that US Special Representative for Afghanistan Zalmay Khalilzad would travel to the region to push for an agreement on prisoner exchanges and a reduction in violence.