Operations would continue against the thousands of foreign troops in the country, and the militants would defend themselves if attacked, a communique said.
The ceasefire, the first offer of its kind, will begin either on Friday or Saturday, as Eid al-Fitr, which marks the end of the Muslim fasting month of Ramadan, falls on one of these days.
Just hours before the Taliban's Saturday announcement, at least 17 soldiers were killed when their checkpoint came under attack by the Taliban in western Herat province, said Gelani Farhad, spokesman for the provincial governor.
"The government announced a truce on the basis of Ulema's verdict to show to the world and Afghans that it had taken the initiative for peace months back and now is even willing to announce a truce and is pacifist". We can be hopeful if the truce is extended for a longer time.
The Taliban said "foreign occupiers are the exception" to the order sent to its fighters around the country.
The infamous Donald Trump and Kim Jong-un impersonators return
The self-proclaimed master dealmaker is facing doubts from multiple corners as he prepares to negotiate with Kim Jong Un . The level of concern is higher, though, in Japan, another US treaty ally in Asia with much at stake.
The clerics also recommended a ceasefire with the Taliban, who are seeking to reimpose strict Islamic law after their ouster in 2001, and Ghani endorsed the recommendation, saying it would last until June 20.
The move for a ceasefire was first announced by President Ashraf Ghani on Thursday.
In February Ghani unveiled a plan to open peace talks with the Taliban, including eventually recognizing them as a political party.
The UN Secretary-General´s Special Representative for Afghanistan, Tadamichi Yamamoto, said in a statement he hoped the ceasefires would "serve as a stepping stone" towards peace talks between the Afghan government and the Taliban.
A member of security personnel stands guard in Kabul, Afghanistan.
Liverpool’s Mo Salah still unsure whether he will start Egypt’s first match
My comment is that it's always okay when the one who made you cry first, then makes you laugh", he said. That doesn't go through my head", he said.
Farhad said one soldier was wounded.
"You can't end 40 years of war in a few days, but this is definitely the best chance for a peace process since at least since the US surge" of troops under President Barack Obama in 2010-2011, said Vikram Singh, a former Pentagon and State Department official who is now a senior fellow at the Center for American Progress in Washington.
On Friday, senior USA officials said they will intensify combat against Daesh affiliate in the country during the Kabul government's temporary halt to attacks on the Taliban. It wound down its combat mission in 2014 but its Resolute Support mission comprises nearly 16,000 troops from around 40 countries.
In its statement, the Afghan Taliban said it would allow prisoners to visit with families and asked for the group's regional leaders to commute some prisoners' sentences. However, it insisted that attacks on foreign forces should continue.
The 10 included five Pakistanis killed in the clash in the eastern province of Nangarhar, the official said, adding, "We finished the operation and will now follow the ceasefire plan".
Trump calls North Korea summit 'one-time shot' for Kim
The Kim sit-down comes as Trump's worldwide negotiating skills have faced their toughest tests to date with mixed results. Relations warmed rapidly, hitting a crescendo soon after with the first meeting of Korean leaders in more than decade .