KABUL — President Ashraf Ghani declared Saturday that he was ending a unilateral cease-fire with the Taliban, after insurgent attacks killed dozens of Afghan forces across the country last week.
‘‘The cease-fire is over,’’ he told reporters in the presidential palace, saying he was ordering Afghan defense and security forces to restart operations for the first time since he announced an unprecedented unilateral truce with the Taliban in early June.
But the president said the door to negotiations will remain open, and he asked the Taliban to join a peace process.
So far, the militant group has refused to talk with the Kabul government, disparaging it as a ‘‘puppet’’ regime and demanding direct talks with the United States.
Although insurgent leaders rejected Ghani’s invitation to extend the cease-fire after it ended June 17, the president said the three-day mutual truce had been ‘‘98 percent successful’’ and that the government is ready to extend it any time the ‘‘Taliban are ready.’’
The brief truce, which coincided with the three-day Eid holiday marking the end of the Ramadan fasting month, was observed strictly by both sides in the 17-year civil conflict and was marked by an outpouring of emotional celebration among civilians, Afghan forces, and Taliban fighters.
During the Taliban cease-fire, thousands of the group’s fighters flooded cities and towns and mingled cordially with others.
Taliban and Afghan government security personnel were seen laughing together and in some cases taking selfies as they embraced. Taliban on motorcycles roared through the cities, visiting family and friends.
The unexpected success of the truce generated widespread hopes among both Afghans and foreign officials supporting the Ghani government that the Taliban may be willing to engage in some form of talks after many months of refusing to do so.
The truce also invigorated a nascent propeace movement among Afghans, who have held marches, rallies, and vigils calling for an end to the violence.
More than 100 peace marchers walked several hundred miles from southern Helmand province to Kabul during the truce.
Ghani immediately offered to extend the original cease-fire as soon as it ended, but the Taliban declined and have said nothing publicly about the issue since — instead actively stepping up attacks in numerous provinces.
Insurgents intensified attacks on police and army posts, leaving nearly 100 soldiers and police officers dead, according to Afghan media reports.
The government truce did not extend to the Islamic State, a foreign-based Sunni Islamic militia, and other foreign terrorist groups operating in Afghanistan.
During the cease-fire, the Islamic State claimed it carried out two separate deadly attacks on gatherings of Taliban, civilians, and Afghan forces celebrating in eastern Nangahar province.
A spokesman for the ministry of defense said Saturday that the government truce extension had ended at midnight and that military operations were being launched in 10 provinces.
‘‘We will continue our offensive against the elements who are posing threat to our people,’’ he said.
The Defense Ministry said gunmen shot and killed a senior police special forces commander barely 24 hours before the cease-fire was to end at midnight Friday.
Azizullah Karwan, a dogged fighter of the Taliban, was gunned down as he picnicked with his family in the Afghan capital Kabul, ministry spokesman Mohammad Radmanish said.
Karwan was stationed in Afghanistan’s restive eastern province of Paktika, where he worked closely with US special forces.
In the days after Eid celebrations, an audiotape prepared by the son of the late Taliban leader, Mullah Mohammed Omar, circulated among insurgents, the Associated Press reported. On the tape, Mohammed Yaqoub used harsh language as he chastised Taliban fighters for their cavorting with the enemy.