By Mushtaq Yusufzai, Saphora Smith and The Associated Press

PESHAWAR, Pakistan — The Afghan Taliban announced a three-day cease-fire Saturday in an unprecedented move to put fighting on hold during the Eid al-Fitr holiday, which marks the end of Ramadan.

The announcement came days after Afghan President Ashraf Ghani announced that government troops would observe a week-long cease-fire with the militant group beginning on 27 Ramadan, or June 12 on the Western calendar, and lasting through June 19. A statement from the president's office said the cease-fire does not include al Qaeda or the Islamic State.

Spokesman Zabihullah Mujahid said Taliban commanders have directed their fighters to refrain from attacking the Afghan security forces for three days, but said foreign forces remained a target.

The group warned that if they come under attack they would retaliate, a Taliban military commander told NBC News. The commander spoke on the condition of anonymity because he is not allowed to speak to the media.

The military council met for three days to discuss the government's proposal for a cease-fire deal, before announcing their own shorter cease-fire on Saturday.

"The top leadership headed by Taliban supreme leader Sheikh Haibatullah Akhunzada decided to give a positive message to the Afghan people and agreed to announce a ceasefire for Eid al-Fitr,” the Taliban military commander said.

The Taliban's military council also directed its commanders to release minor prisoners, he added, while those who had committed more serious crimes would be able to meet with their families during the holiday.

Mujahid, the Taliban's spokesman, said the military council wanted the Afghan nation to celebrate Eid al-Fitr without fear, promising that the Taliban would not carry out attacks or violence during the festival.

Omar Zakhilwal, Afghanistan's Ambassador to neighboring Pakistan, described the announcement as an "important step towards prospects for peace."

"Hope the pleasure of shedding no Afghan blood in Eid becomes so overwhelming that rest of year is also declared as Afghan Eid," he said on Twitter.

Eid is the biggest festival in the Muslim calendar when families visit each other's homes, enjoy feasting and in Afghanistan tend graves of fallen loved ones.

While they have been fighting the U.S.-backed government since being ousted from power in 2001, the Taliban have steadily expanded their presence in the country in recent years, capturing a number of districts.

A military vehicle damaged in a battle between Afghan security forces and Taliban in western Farah Province in May. Reuters

The group carries out near-daily attacks, mainly targeting Afghan security forces. They have launched attacks during Eid in the past.

Gen. Mohammad Sharif Yaftali, the army's chief of staff, told reporters on Thursday that Afghan forces would be on standby throughout the cease-fire and would respond if necessary.

The U.S. and NATO formally concluded their combat mission in Afghanistan in 2014, but the U.S. still has thousands of forces based there in a support and counterterrorism role.

The Trump administration has sent additional troops to try to change the course of America's longest war and forcing the Taliban to the negotiating table.

In a statement, the U.S. forces said that they, too, would observe the cease-fire with the Taliban, but that it would not affect their counterterrorism efforts against terrorist groups like the Islamic State and Al Qaeda.

"We will adhere to the wishes of Afghanistan for the country to enjoy a peaceful end to the Islamic holy month of Ramadan, and support the search for an end to the conflict," said Gen. John Nicholson, commander of U.S. forces in Afghanistan.

In a separate statement, the U.S. State Department said it welcomed Ghani's offer.

"We stand with the Afghan people as they law the foundation for an Afghan-owned and Afghan-led peace process," Secretary of State Mike Pompeo said.

The U.S. has said it is open to an Afghan-led peace process. Nicholson last month said that elements of the Taliban are showing interest in peace talks.

Mustaq Yusufzai reported from Pakistan, and Saphora Smith from London.