"We welcome the three days ceasefire announced by the Taliban starting on the first day of Eid".
United States forces said they would honour the Afghan government ceasefire.
The Taliban attacked security outposts in the Zawul district of western Herat province on Friday night, killing 17 troops and wounding several, Jelani Farhad, spokesman for the provincial governor, said.
"If different factions don't accept the ceasefire, then attacks will continue". The fighting also killed more than 180 Afghan civilians in May. But it added that if attacked "we will strongly defend [ourselves]".
The attack late Saturday comes ahead of a three-day cease-fire timed to coincide with Eid marking the end of Ramzan.
The presidential palace welcomed the announcement and said it hoped it can lead to lasting peace.
Afghan President Ashraf Ghani announced a unilateral cease-fire Thursday, a gambit meant to apply pressure to the Taliban as Afghan civilians have begun pleading more vocally for peace after decades of conflict.
The Taliban has not claimed the responsibility of the attack.
But casualties from suicide bombings and attacks were up 17% a year ago as the Taliban and IS ramp up assaults in urban areas, particularly Kabul.
"It is a good move by the government and Taliban".
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.
It has also called for a peace process, but it remains uncertain whether American officials will resume discussions it has had intermittently with Taliban representatives since 2010.
On Friday, senior US officials said they will intensify combat against the Islamic State affiliate in the country during the Kabul government's temporary halt to attacks on the Taliban.