KABUL — Afghan President Ashraf Ghani on Sunday announced a ceasefire with Taliban insurgents beginning Monday to mark the Muslim Eid al-Adha holiday, despite the heavy fighting seen over recent days in the central city of Ghazni.

"The conditional ceasefire will start tomorrow and it will continue as long as the Taliban preserves and respects it," he said in an Afghan Independence Day ceremony in Kabul.

"We call on the leadership of the Taliban to welcome the wishes of Afghans for a long-lasting and real peace," he said.

A senior official in Ghani's office said the "conditional" ceasefire would run for three months. Eid is the annual Islamic feast of sacrifice, which officially begins on Tuesday.

In a statement obtained by NBC News on Saturday, the Taliban said peace in Afghanistan would be unattainable as long as Americans occupied the country.

"Bringing peace and security is from among the highest priorities of the Islamic Emirate, but peace will remain elusive during an occupation and neither is salvation possible without the establishment of an Islamic authority," the statement read.

The statement went on to reiterate the group's position that direct talks with the United States is the only way to bring the 17-year war with the nation to an end.

By Sunday, the Taliban was expected to approve of the ceasefire, but leaders of the group said it might not be announced publicly.

“We will convey it to our military commanders through our personal communication tools and would stop them to cease all their operations for four days. The ceasefire will be effective from Monday and conclude on Thursday,” said the Taliban shura member on condition of anonymity.

Taliban said that during the ceasefire, they will not attack the Afghan troops and other security forces but would defend themselves in case they came under attack.

This month the Taliban fought an intense battle with Afghan forces to control the strategically important city of Ghazni.

At least 150 soldiers and 95 civilians were killed in a five-day siege, which eased last week when Afghan soldiers backed by U.S. forces pushed back the heavily armed rebels.

The Taliban said in a statement that they had control over half of Afghanistan.

Blasts, suicide attacks and clashes between hardline Islamic militants and Afghan forces killed over 1,600 civilians in the first six months of the year, the highest number in the past decade, the United Nations said in a statement on Sunday.

Ghani's ceasefire announcement was limited to the Taliban and excluded other militant groups such as Islamic State.