Hundreds of prisoners have broken out of a Benghazi jail following a riot.

One official said the freed prisoners numbered at more than 1,000 but this could not immediately be verified.

Meanwhile, Libya's prime minister said he would reshuffle the cabinet and reorganise the government to cope with the "urgent" situation in the country.

The move follows killings in the eastern city of Benghazi that sparked violent demonstrations.

Hundreds took to the streets overnight to denounce the assassination of a prominent political activist and critic of the Muslim Brotherhood, Abdelsalam al-Mosmary.

Mr Mosmary was shot dead yesterday after leaving a mosque in Benghazi.

The demonstrations turned violent, and protesters today attacked the Benghazi and Tripoli offices of the Muslim Brotherhood's political party.

They also attacked the headquarters of a liberal political coalition in the capital.

Mr Mosmary was one of the first activists to take to the streets in Libya's February 2011 uprising.

He was an outspoken opponent of the Brotherhood, whose Islamist political wing is the second biggest party in Libya's General National Congress (GNC).

Libya's government is struggling to assert its authority over armed groups that helped topple veteran leader Muammar Gaddafi in 2011.

Libya's border with Egypt was closed to prevent Mr Mosmary's killers from fleeing with only cargo trucks allowed to pass.

Hundreds gathered outside Benghazi's Tibesti hotel, one of the main squares in the city for demonstrations, for funeral prayers for Mr Mosmary before heading to a cemetery.

They continued to shout anti-Brotherhood slogans.

In Tripoli, a crowd stormed JCP headquarters before heading on to ransack the headquarters of the liberal National Forces Alliance (NFA), the country's biggest political party founded by wartime rebel prime minister Mahmoud Jibril.

There has been rising opposition in Libya to the influence of the Muslim Brotherhood, which has links to several government ministers.

The movement has struggled to convince Libyans wary of foreign interference that it has no financial or administrative links to its namesake in Egypt, whose Islamist president Mohamed Mursi was overthrown by the army on 3 July.

Tensions are also high between secularists and the ruling Islamists in Tunisia, where the funeral of an assassinated secular politician took place today.

Many of the protesters accused the Brotherhood of being behind the killings in Benghazi, cradle of the 2011 revolution and now a hotspot for violence - a charge rejected by Abdulrahman al-Dibani, a JCP member in congress.

Libyans are growing increasingly frustrated as they witness continuous political squabbling and lawlessness across the North African country, a major oil producer.

The GNC passed a law this month for the election of a 60-member committee that will draft the country's new constitution after months of infighting.

Officials for the NFA were not immediately reachable for comment. A party source said the alliance was scheduled to meet on Sunday to discuss its next move, potentially even looking at pulling out of the GNC.

The NFA, which has just under 40 seats, has already boycotted sessions in the past.