Afghan President Ashraf Ghani announced a ceasefire with Taliban insurgents from Monday to mark the Muslim Eid al-Adha holiday, days after fighting in the central city of Ghazni and a northern province.
Taliban sources said their leaders had also provisionally agreed a four-day truce during the annual Islamic feast of sacrifice, though supreme leader Sheikh Haibatullah Akhunzada still had to give his final approval.
The militant movement said it would free hundreds of prisoners, without going into further details.
Fighting has been mounting in the Taliban's insurgency against the government in Kabul and NATO coalition forces, launched after the Islamist group was ousted from power in a US-led military intervention in 2001.
The truce announcement came a day after clashes erupted in the northern province of Faryab, an interior ministry official said. The Taliban had taken control of part of Bulcheragh district and more than 50 government forces were missing, he added.
Battle for Ghazni
This month at least 150 soldiers and 95 civilians were killed in a five-day battle for control of Ghazni. Afghan soldiers backed by US forces managed to push back the heavily armed rebels last week.
Earlier on Sunday, the United Nations said blasts, suicide attacks and clashes killed more than 1,600 civilians in the first six months of the year, the highest number in the past decade.
"The conditional ceasefire will start tomorrow and it will continue as long as the Taliban preserves and respects it," Ghani said in a ceremony celebrating 99 years of independence from British rule.
"We call on the leadership of the Taliban to welcome the wishes of Afghans for a long-lasting and real peace," he added.
A senior official in Ghani's office said the conditional ceasefire would run for three months, until the Prophet Mohammed's birthday which Afghanistan celebrate on November 21.
It would only cover the Taliban, not other groups including Daesh, officials said.
Since the withdrawal of most foreign combat troops in 2014, the Taliban has made slow but steady gains, now controlling or contesting more than 40 percent of Afghanistan.
In June this year, Ghani announced an unconditional ceasefire with the Taliban for about two weeks. The Taliban observed a ceasefire over the three-day Eid al-Fitr festival but rejected the government’s request to extend it.
Jens Stoltenberg, the secretary general of NATO, welcomed President Ghani's announcement. "I encourage the Taliban to demonstrate their concern for Afghans by respecting it," he tweeted.
US Secretary of State Mike Pompeo said the US is ready to support and facilitate direct peace talks between the Afghan government and the Taliban.
"The United States welcomes the announcement by the Afghan government of a ceasefire conditioned on Taliban participation," Pompeo said in a statement. "This plan responds to the clear and continued call of the Afghan people for peace."
He said Washington was ready to back direct negotiations between the government and militant movement. "There is no obstacles to talks. It is time for peace," Pompeo said.