JALALABAD, Afghanistan — A militant assault on a prison complex in eastern Afghanistan ended on Monday after a 20-hour gun battle, leaving 29 people dead and officials scrambling to recapture hundreds of prisoners, including many from the Islamic State and the Taliban.
The attack at the prison in Jalalabad City was claimed by the Islamic State. It began on Sunday night when a brief cease-fire between the Afghan government and the Taliban was still in place. Its timing underscored the complexity of a conflict that is growing deadlier by the day, even as peace talks face obstacles.
Gen. Yasin Zia, the chief of the Afghan army who arrived in the city to lead the last stretch of the operations, said ten assailants were involved in the attack and all were killed. The security perimeter was first breached with a car-bomb before attackers with assault rifles streamed in and started a gun battle with prison guards.
At least 29 people had been killed and 48 others wounded, according to Attaullah Khogyani, a spokesman for the governor of Nangarhar Province. The casualties included civilians, inmates and security forces, he said.
The assault, which left much of the prison’s security barriers destroyed and brought the city to a standstill, was one of the most complicated operations claimed by the Islamic State’s chapter in Afghanistan.
As its territory has been constricted significantly by a campaign of military operations over the past couple of years, the group has largely turned to gruesome attacks on soft-targets, such as civilians with little protection.
But the Islamic State may not be the biggest winner in the jailbreak. A senior Afghan official, speaking on the condition of anonymity, said that only a third of the prison’s population of about 1,800 included ISIS loyalists. The rest were split among Taliban prisoners and criminals. All of them got a chance to break free, at least for a while.
Mr. Khogyani said about 1,000 prisoners who had tried to escape had been recaptured, and that another 400 — stuck inside the jail during the shootout — had been rescued.
The rest of the population was still unaccounted for, but with the prison’s security still compromised, and with the area under tight military restrictions, figures were difficult to verify.
The jailbreak came at a time when prisoners in Afghanistan have frequently been in the news. Conflict over the release of Taliban prisoners as part of an agreement reached in February between the United States and the Taliban has delayed the next steps of the agreement, mainly the start of direct talks between the Taliban and the Afghan government.
Afghan prisons have been crucial targets for combatants throughout decades of war, and during the Taliban insurgency of recent years, the insurgents have freed hundreds of prisoners at a time in such attacks. On Monday, a Taliban spokesman denied having anything to do with the attack on the Jalalabad prison.
Nangarhar has been a stronghold of the Islamic State in Afghanistan. But intense operations by Afghan forces, often backed by American air power, has reduced the group’s presence significantly. Afghan officials said on Saturday that they had also killed a senior leader of the group in the province.
While the Taliban and ISIS have fought bloody turf wars in eastern Afghanistan, Afghan officials have long claimed that elements of the two groups have overlapped, at times sharing networks and resources for urban attacks.
The murky identity of the ISIS branch in the country has made it a threat to the peace process. During the first cease-fire between the Taliban and the Afghan government in 2018, the Islamic State claimed a deadly bombing in Nangarhar that killed nearly 40 people.
The attack on the jail came during the final hours of a three-day cease-fire between the Taliban and the Afghan government for the Muslim festival of Eid al-Adha. Afghan officials said that violence during the cease-fire had dropped, but the insurgents were still behind 38 incidents over the three days.
Afghan security officials warn that the Taliban has exploited a complicated battlefield to strike blows with deniability so it can maintain its deal with the U.S., often hiding behind the Islamic State as cover.
One senior Afghan official said that detained fighters — who have their fingerprints checked and eyes scanned — are often already in the system as having been previously arrested or associated with attacks carried out by the Haqqani network, a lethal arm of the Taliban.
Just hours before the cease-fire for Eid al-Adha went into effect on Thursday, a deadly car-bomb in Logar province killed at least 15 people. While the Taliban denied they were behind the attack, Massoud Andarabi, Afghanistan’s interior minister, said they had “solid intelligence” that the attack was designed by a local Taliban commander in the province.
Mr. Andarabi said he had little doubt anymore that cells formerly carrying out urban attacks for the Haqqani network were closely cooperating with what remains of the Islamic State’s chapter in the country.
“Shahab Almahajir, the newly appointed leader of Islamic State of Khorasan Province, or I.S.K.P., is a Haqqani member,” Mr. Andrabi said. “Haqqani and the Taliban carry out their terrorism on a daily basis across Afghanistan, and when their terrorist activities do not suit them politically, they rebrand it under I.S.K.P.”
Zabihullah Mujahid, a spokesman for the Taliban, rejected Mr. Andarabi’s claims as “rumors to muddy the public perception.”
The U.S.-Taliban deal called for the Afghan government to free 5,000 Taliban prisoners in exchange for 1,000 Taliban-held members of the Afghan security forces. The swap was supposed to take place early this year over 10 days, after which the Taliban and the Afghan government were expected to have direct negotiations.
The Afghan government initially resisted the prisoner release, and then gave in to a phased release following pressure from the Trump administration. More recently, President Ashraf Ghani, of Afghanistan, said that he would not release the last 400 of the 5,000 prisoners on a list provided by the Taliban, as those prisoners were accused of serious crimes.
It wasn’t immediately clear whether any of the 400 prisoners on the list were held in the prison in Jalalabad.
One Afghan official said that it was possible a few of those Taliban prisoners were there, but that most high-profile prisoners are held at the central jail in Kabul, or a highly protected facility near the U.S. military base in Bagram.
While the Taliban has completed its release of the 1,000 prisoners, Mr. Ghani has proposed a new deal to settle his end of the bargain. He has committed to releasing 500 different Taliban members instead of the 400 on the list presented by the insurgents.
Mr. Ghani has called a council of elders from across Afghanistan to consult on whether to free the 400 accused of grave crimes as well. The grand consultation, called a Loya Jirga, is expected to happen later this week.
Zabihullah Ghazi reported from Jalalabad, and Mujib Mashal from Kabul, Afghanistan.