JALALABAD, Afghanistan (AP) -- Militants affiliated with the Islamic State group stormed a prison in eastern Afghanistan in a daylong siege that left at least 39 people dead, including the assailants, and freed nearly 400 of their fighters before security forces restored order, a government official said Monday.
The attack underscored that the Islamic State affiliate in Afghanistan is still a formidable presence, and it highlighted the challenges ahead as U.S. and NATO forces begin to withdraw following Washington's peace deal with the Taliban.
The peace accord aims to recruit the Taliban to battle the militants from IS, which U.S. officials have told The Associated Press is the Americans' biggest foe in Afghanistan. Both the Taliban and the IS affiliate are staunch rivals.
At least 10 of the dead were IS militants involved in the assault to free their comrades from the prison in Jalalabad, the capital of Nangarhar province, said Ajmal Omar, a provincial council member. The rest of the dead were believed to be prisoners, civilians and Afghan forces, although no official breakdown was given.
Another 50 people were wounded in the attack that began Sunday when a suicide bomber detonated his explosives-packed vehicle at the entrance to the prison complex some 115 kilometers (70 miles) east of Kabul, Omar said.
Other militants simultaneously stormed the prison and took up positions in nearby residential buildings. They fired on Afghan troops for several hours, even after the security forces retook the prison and began recapturing some of the inmates.
Of the five prisoners killed by the militants, at least three were members of the Taliban, showing the tensions between the two factions.
An AP photographer who went inside the prison, which houses about 1,500 inmates, said he saw the bodies of five of the attackers and at least four prisoners.
Omar said about 430 prisoners stayed in their cells or hid during the siege. It was unclear Monday how many prisoners remained at large.
One inmate, who gave his name as Azizullah, said he heard the powerful explosion, followed by the militants storming into the main prison block, shouting for their fighters and telling them to flee.
“The aim of this attack was to rescue all Daesh members inside the prison, and unfortunately that included five or six senior Daesh people,” Omar said, using an Arabic acronym for the Islamic State group, which is also known as ISIS. Among the prisoners who escaped was the group's shadow governor for neighboring Kunar Province, he said.
The Islamic State affiliate in Afghanistan, known as IS in Khorasan Province, claimed responsibility for the attack. The militants have established a base in Nangarhar Province.
Afghanistan has seen a recent surge in violence, with most attacks claimed by IS militants. U.S. and Afghan forces — along with the Taliban — have pounded IS positions.
While the group's strength might have been reduced, analysts say it is still able to stage such high-profile attacks such as the jailbreak.
"Rumors of the demise of ISIS in Afghanistan are greatly exaggerated. It retains the capacity to carry out attacks, and it continues to gain new recruits ranging from disaffected former Taliban fighters to newly radicalized young Afghans," said Michael Kugelman, deputy director of the Asia Program at the Washington-based Wilson Center.
"The attack on the jail took place in terrain where ISIS has long had a deep presence, and it used tactics that the group has frequently deployed in Afghanistan," he said. "It amplifies, for Kabul and Washington and other NATO partners, just how serious the ISIS challenge remains.”
On Saturday, authorities said Afghan special forces killed a senior Islamic State commander near Jalalabad.
The Taliban's political spokesman, Suhail Shaheen, told the AP that his group was not involved in the prison attack.
“We have a cease-fire and are not involved in any of these attacks anywhere in the country,” he said.
The Taliban had declared a three-day cease-fire starting Friday for the major Muslim holiday of Eid al-Adha. The cease-fire expired at midnight Sunday, although it wasn't immediately clear if it would be extended.
The U.S. reached the peace deal with the Taliban in February, but a second, crucial round of negotiations between the Taliban and the political leadership in Kabul has yet to begin.
Washington has been pushing for an early start to intra-Afghan negotiations that have repeatedly been delayed since the Taliban accord was reached.
In a tweet late Monday, Shaheen said U.S. Secretary of State Mike Pompeo held a video call with the Taliban's chief negotiator, Mullah Abdul Ghani Baradar. His Pashto language tweet said Pompeo welcomed the cease-fire.
Shaheen repeated the Taliban's demand that the Afghan government free all 5,000 Taliban prisoners it holds in line with the deal. President Ashraf Ghani has refused to release the last 400, calling a grand council of elders for Thursday to decide the issue.
While the Islamic State group has seen its so-called caliphate stretching across Iraq and Syria eliminated after years of fighting, the group has continued its attacks in Afghanistan. The extremists also have battled the Taliban, which was overthrown by the U.S. in a 2001 American-led invasion following the Sept. 11 attacks.
A United Nations report released last month estimated the membership of IS in Afghanistan at 2,200. While its leadership has been depleted, IS still counts among its leaders a Syrian national Abu Said Mohammad al-Khorasani.
The report also said the monitoring team had received information that two senior Islamic State commanders, Abu Qutaibah and Abu Hajar al-Iraqi, had recently arrived in Afghanistan from the Middle East.