The Afghan Taliban has announced a three-day cease-fire over the Eid-al-Fitr holiday, their first offer of its kind, following an earlier unilateral cessation of hostilities announced by the government.

But the militant group warned that the suspension of fighting for the first three days of Eid-al-Fitr, the holiday that marks the end of the fasting month of Ramadan, did not extend to foreign forces, who would continue to be targeted.

Despite the announcement, officials said on June 9 that Taliban militants had killed over 40 government security personnel in attacks across the country.

At least 25 local policemen were killed when militants stormed three checkpoints in the Qala-e Zal district of the northern province of Kunduz on June 9, said Amanaddin Qureshi, the governor of neighboring Imam Sahib district.

Qureshi said eight militants were killed and nine wounded in the clashes.

In the western province of Herat, at least 17 Afghan soldiers were killed when Taliban fighters attacked a checkpoint in the Zawol district, provincial government spokesman Jelani Farhad said.

Farhad said at least 13 others were wounded in the attack.

Rare Positive Sign?

The unexpected cease-fire came two days after Afghan President Ashraf Ghani's own surprise announcement of a weeklong halt to operations against the Taliban and allied Haqqani network.

The government truce, which excludes the Islamic State (IS) extremist group and Al-Qaeda, will last from June 12 until around June 20. The Taliban's cease-fire is expected to run from June 15 to June 17.

It is the first time since the U.S.-led invasion of Afghanistan that toppled the Taliban regime in 2001 that the militants have declared a cease-fire, albeit a limited one.

Taliban fighters "are directed to stop offensive operations against Afghan forces for the first three days of Eid-al-Fitr," the group said in a statement on June 9. But it added that if attacked "we will strongly defend [ourselves].”

The statement said the Taliban may also consider releasing prisoners of war, if they promise not to return to the battlefield.

"We welcome the three days ceasefire announced by the Taliban starting on the first day of Eid," Ghani said on Twitter after the Taliban announcement.

Although the Taliban's cease-fire was not in direct response to Ghani's offer, it remains a rare positive sign for the troubled peace process.

"Taliban’s announcement of cease-fire with ANSF during Eid & indication to release some captives is encouraging & important step towards prospects for peace," Omar Zakhilwal, Afghanistan's ambassador to Paksitan, wrote on Twitter on June 9.

Ghani's decision came after Islamic clerics declared a fatwa, or ruling, against suicide bombings at a gathering in Kabul that itself was the target of a suicide attack claimed by IS militants that killed 14 people.

Ghani endorsed a recommendation by the clerics for a cease-fire with the Taliban.

Ghani has urged cease-fires with the Taliban before, but this was the first unconditional offer he made since he was elected in 2014.

Despite more aggressive military operations against the Taliban under a new approach adopted by U.S. President Donald Trump last year, the Taliban still hold large swaths of the country.

The United States had said its forces and coalition partners will honor the cease-fire.

The top U.S. general in Afghanistan said military operations against IS would intensify during the temporary cease-fire.

With reporting by AFP, dpa, and Reuters