KABUL, Afghanistan — Two gunmen opened fire on a crowded event in Kabul attended by the opposition leader Abdullah Abdullah on Friday, and officials said at least 32 civilians were killed and dozens wounded. The attackers struck Afghanistan’s capital less than a week after the United States and the Taliban signed an agreement aimed at ending the 18-year-old war.
Mr. Abdullah escaped injury in the attack, his aides confirmed. But it took Afghan security forces five hours to hunt down the assailants, who had used a nearby high-rise to fire into the crowd, before the government declared the attack over.
The country’s health ministry said at least 58 people were wounded. Dawod Danish, head of the main hospital nearby, said 26 bodies and 20 wounded people had been brought to his facility alone.
The attack came at a particularly delicate time in Afghanistan. Political tensions have been at high pitch in recent weeks, with Mr. Abdullah challenging the results of an election that declared the incumbent president, Ashraf Ghani, the winner of another five-year term in office. Mr. Abdullah also declared victory, and had threatened to hold a rival inauguration at the same time as Mr. Ghani’s if it went ahead as scheduled.
The inauguration was originally set for the eve of the agreement-signing between representatives of the United States and the Taliban last Saturday in Doha, Qatar. American diplomats had managed to buy some time by convincing the Afghan government to postpone the inauguration until after the signing, hoping the rival Ghani and Abdullah factions could find their own negotiated solution.
The Taliban, who within days of signing the deal with the United States had resumed attacks against Afghan government forces, immediately denied involvement in the assault on the Kabul event on Friday. Hours later, the Islamic State’s branch in Afghanistan claimed responsibility, according to the AFP news agency.
The event was a ceremony commemorating the killing of an ethnic Hazara leader, Abdul Ali Mazari, by Taliban militants in 1995. Most Hazaras are Shiite Muslims, a persecuted minority in Afghanistan and a favorite target of Islamic State loyalists in recent years. But attacks by the Islamic State had dropped off sharply after a sustained offensive against them last year.
President Ghani called the attack “a crime against humanity and against the national unity of Afghanistan” and said he had spoken to Mr. Abdullah on the phone. But many of the opposition leaders who were at the event have raised questions about the lapse of security.
“We are in a sensitive time. The investigations need to be thorough, and not like past incidents that remained vague,” Mr. Abdullah told local media after the attack.
Mohammed Mohaqiq, another senior leader present at the event, said the security forces had assured them they had secured the area. He seemed to suggest the lapse had been deliberate.
“Those in the palace are writing on their Facebook pages saying ‘why weren’t the political leaders in attendance killed?’” Mr. Mohaqiq wrote on his Facebook page. “As if their bullets missed their target.”
The attack has once again raised concerns about whether the American deal with the Taliban to extricate United States forces from the conflict can help end the bloodshed for Afghans.
Even as the Taliban denied responsibility for the Kabul assault, they have resumed their attacks on Afghan forces across the country, refusing to forsake violence as their leverage. The conflict has gone on for so long, and with so much overlap among the violent players, that it is often difficult to identify the plotters of an attack.
The Islamic State chapter in Afghanistan for several years had a foothold in eastern Nangarhar province. Carnage in urban centers, particularly striking Shiite soft targets such as mosques and wedding halls, was also carried out in its name.
In recent months, both the Afghan government and the Taliban had said the Islamic State offshoot was largely defeated in Nangarhar province. But concerns have remained that Islamic State cells could regroup in surrounding provinces.
Najim Rahim reported from Kabul, Afghanistan, and Mujib Mashal from Doha, Qatar.