About 100 inmates out of more than 1,100 escaped convicts who fled during a prison riot in the eastern Libyan city of Benghazi have been recaptured, according to officials.
The prisoners were retaken on Sunday, the day after 1,117 inmates broke out of the Kuafiya prison on the outskirts of the city.
Officials said there had been an attack on the facility from outside as well as a riot inside.
Mohammed Sharif, head of security in Benghazi, said some prisoners had turned themselves in and others had been captured.
"The prison is back in operation as of this morning," he told Reuters. "Seventy prisoners were brought in initially. Another 30 were caught in the town of al-Marj and seven in Ajdabiyah," he said.
Officials said the escapees included criminals from other African states.
Elsewhere in Libya on Saturday, protesters stormed the offices of political parties in Libya's main cities.
Protesters had massed across the country angry over the killing of an activist critical of the country's Muslim Brotherhood group.
"There was a riot inside Al-Kuifiya prison, as well as an attack from outside. More then 1,000 prisoners escaped," the official said on Saturday, asking not to be named.
"Special forces called in as reinforcements were given orders not to fire at the prisoners."
Suleiman El-Dressi, a journalist in Benghazi, told Al Jazeera that according to security sources, "the prisoners exploited the turmoil that was happening in the city and tried to escape".
"Three were shot dead, and the others managed to get away."
Residents of the area carried out the attack because they don't want the prison near their homes
The official said most of the escapees were common law detainees, including nationals of other African states.
"But some of them were detainees in cases linked to the former regime of Muammar Gaddafi," he said.
Several were recaptured shortly after the breakout.
Prime Minister Ali Zeidan confirmed the incident, without giving the number of fugitives.
"Residents of the area carried out the attack because they don't want the prison near their homes," he said, adding that border posts had been alerted and given a list of names to apprehend the escapees.
Zeidan earlier announced that border posts with Egypt had been closed to prevent the escape of the killers of a prominent activist in the eastern Libyan city on Friday.
Benghazi's security situation is among the most precarious in post-revolution Libya.
Last year, the US ambassador and three other Americans were killed in an attack there.
Meanwhile on Saturday, hundreds gathered in the capital Tripoli after dawn prayers, denouncing the Friday shooting death of activist and lawyer Abdul-Salam Al-Musmari.
They set fire to tires in the street and demanded the dissolution of Islamist parties.
The two incidents highlighted Libya's precarious security situation and the challenges the North African country faces as it tries to restore security nearly than two years after the ouster and killing of longtime leader Gaddafi.