Afghan security forces retook control of a prison from Islamic State group militants in the eastern city of Jalalabad on Monday, ending a siege in which hundreds of prisoners escaped.
At least 29 people were killed in the assault on the prison that began on Sunday evening and in subsequent clashes with security forces, a spokesman for the governor of Nangarhar province said.
"The attack is now over," Sohrab Qaderi, a member of the provincial council, told Reuters after security forces clashed overnight and into the day with militants who had taken over the prison watchtowers.
More than 300 prisoners were still at large, according to Attaullah Khugyani, spokesman for the governor of Nangarhar province. Of the 1,793 prisoners more than 1,025 had tried to escape and been recaptured while 430 had remained inside.
"The rest are missing," he said.
Khugyani said civilians, prisoners and members of the security forces were among the 29 dead and more than 50 wounded before the final assault.
A defence ministry statement said all 10 attackers had been killed by Afghan security forces, though a provincial council member and a witness inside the prison told Reuters the number was likely around 30.
The attackers were Islamic State group militants trying to free their comrades from the prison in Jalalabad, the capital of Nangarhar province, said Ajmal Omar, a provincial council member.
"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. Among the prisoners who escaped was the group's shadow governor for neighboring Kunar Province, he said.
The Islamic State (IS) group affiliate in Afghanistan, known as IS in Khorasan Province, claimed responsibility for the attack. The militants have established a base in Nangarhar Province.
The renewed violence comes at a sensitive time as Afghanistan as the United States attempts to launch new peace talks between the Afghan government and the Taliban, who say they oppose the Islamic State group.
Locals near raided Jalalabad prison said 'never heard such intense firing'
After detonating a car bomb at the entrance on Sunday evening, IS group militants overran the prison, where many of the group's fighters who were captured during a campaign in the past month were being held along with Taliban fighters and common criminals.
As the siege dragged through the day, the normally bustling city was placed under a curfew.
"Jalalabad is completely empty," Qaderi said.
Some 130km (80 miles) east of Kabul, Jalalabad lies on the highway leading to the Khyber Pass and the Pakistani city of Peshawar.
The United States is drawing down troops after almost 19 years of war but security has remained volatile as the Taliban continue attacks on Afghan forces and other targets.
A UN report last month estimated there were around 2,200 Islamic State group fighters in Afghanistan. While the group has lost territory and its leadership has been depleted, it remains capable of carrying out high-profile attacks, the report said.
(FRANCE 24 with AP and REUTERS)