Afghan forces have retaken a prison in the country’s east following an hours-long gun battle a day after the facility was targeted by Islamic State militants in an attack that killed 29 people.
The prison is believed to hold hundreds of IS members.
The attack highlighted the challenges ahead for Afghanistan even as US and NATO forces begin to withdraw following a US-Taliban peace deal struck earlier this year.
Afghan Defence Ministry spokesman Fawad Aman said the prison in Jalalabad, the capital of Nangarhar province, was taken back on Monday afternoon.
The fighting had also left at least 50 wounded, he said.
Even as Afghan troops retook the prison, IS militants continued to fire on Afghan security forces from a nearby neighbourhood.
Sporadic gunfire rang out from nearby residential buildings in central Jalalabad, an area of high security near the provincial governor’s office.
As security forces swept through the prison, they found the bodies of two Taliban prisoners apparently killed by the IS group, showing the tensions between the two militant factions battling each other in eastern Afghanistan.
The 29 dead included civilians, prisoners, guards and Afghan security forces, said Attaullah Khogyani, the provincial governor’s spokesman.
The attack began on Sunday when an IS suicide bomber drove a car laden with explosives up to the prison’s main gate, detonating the bomb.
IS militants opened fire on the prison’s guards and poured in through the breach.
However, some of the 1500 prisoners there escaped during the fighting.
Mr Khyogyani said about 1000 prisoners who earlier escaped had been found by security forces across the city.
It wasn’t immediately clear if any prisoners were still at large.
The fighting ended after the final attackers, holed up in the nearby residential complex, were killed, said Aman, the defence ministry’s spokesman.
He said 10 IS attackers were also killed in the operation and that the assailants killed five prisoners, including two members of the Taliban, before the raid ended.