TRIPOLI, Libya — More than 1,000 detainees escaped from a prison near the eastern Libyan city of Benghazi in a massive jailbreak Saturday, as protesters stormed the offices of political parties in Libya’s main cities.
It was not immediately clear whether the jailbreak at the Koyfiya prison came as part of the protests or if inmates received outside help. Protesters had massed across the country angry about the killing of an activist critical of the country’s Muslim Brotherhood group.
Those who escaped either face or were convicted of serious charges, a security official at Koyfiya prison said, confirming the jailbreak. He spoke on condition of anonymity as he wasn’t authorized to speak to journalists.
There also was confusion initially about how many prisoners broke out, with numbers of escapees ranging as high as 1,200.
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.
It was not clear if Saturday’s escape was linked to protests across the country, with demonstrators storming the offices of political parties.
Meanwhile Saturday, hundreds gathered in the capital Tripoli after dawn prayers, denouncing the Friday shooting death of activist Abdul-Salam Al-Musmari. They set fire to tires 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 two years after the ouster and killing of longtime dictator Moammar Khadafy.
In Tripoli, protesters appeared to be inspired by events in neighboring Egypt, where millions took to the streets Friday to answer a call from the army chief, who said he wanted a mandate to stop ‘‘potential terrorism’’ by supporters of the nation’s ousted president, Mohammed Morsi, who hails from the Brotherhood.
Libya’s nascent security forces are struggling to control the country’s militias, most of whom have roots in the rebel groups that overthrew Khadafy in 2011.
Musmari, who had publicly criticized the Brotherhood, was killed by unknown assailants in a drive-by shooting in Benghazi.
Some protesters stormed the headquarters of a Brotherhood-affiliated political party and another Islamist-allied party in the capital, destroying furniture. Witnesses say a Brotherhood party office was also stormed in the eastern city of Benghazi.
Protesters angry about Libya’s weak central government also targeted the liberal National Forces Alliance, ransacking its headquarters.
Militias, many made up of former rebels who fought in the civil war that toppled Khadafy, have grown in the strength and in many areas rival the security forces in their firepower and reach. The armed forces also rely on militias for help securing the country in some cases.
On Saturday, a colonel was killed by unidentified assailants in Benghazi. Three security members were killed a day earlier when gunmen opened fire.