Up to four people have died and dozens of others injured after demonstrators in Benghazi stormed the compounds of militias based in the eastern Libyan city.
Protesters seized the headquarters of the Ansar al-Sharia militia and evicted its fighters from its military bases in the city on Friday night.
The confrontation appeared to be part of a co-ordinated sweep of militia headquarters buildings by police, government troops and activists following a mass public demonstration against armed groups earlier in the day.
At least four people were killed and 34 wounded in Friday's violence, Reuters news agency reported quoting hospital sources.
Ansar al-Sharia has been linked to the attack on the US consulate in Benghazi last week in which J Christopher Stevens, US ambassador to Libya, and three other Americans died amid demonstrations over a YouTube video deemed insulting to Prophet Muhammad.
The group denies any involvement in the killing of Stevens.
Chanting "Libya, Libya," hundreds of demonstrators entered the compound, pulling down militia flags and torching a vehicle inside Ansar al-Sharia's headquarters - once an internal security base under former leader Muammar Gaddafi.
People in the crowd waved swords and even a meat cleaver, shouting "No more al-Qaeda!" and "The blood we shed for freedom shall not go in vain!"
They tore down the banner of group while chanting “no no to the brigades”.
Groups like Ansar al-Sharia, which are said to have played a role in helping to topple the Gaddafi regime, have of late been accused of kidnappings and killings.
Military base seized
As the protesters left Ansar al-Sharia's headquarters, the crowd swelled, reaching thousands as it headed towards the group's military base, which was shared with another militia group.
Protesters said the militia members opened fire as they arrived and several people were wounded.
After the crowd entered that compound, Libyan army lorries sped away from the base carrying government troops cheering in victory and crying out: "God is greatest."
Vigilantes armed with machetes and clubs blocked the highway leading away from the compound, stopping cars to prevent looters from driving off with heavy weapons.
"We went there to hear their slogans and basically what they are saying is that they reject insults to the prophet but they also refuse terrorism in their city," Al Jazeera's Hoda Abdel-Hamid reported from Benghazi..
"They have also called for the disbanding of the militias, chanting: 'What are you waiting for?' They're asking the government how long it will take before they do that."
The demonstrators also took over a compound belonging to the Abu Slim brigade and another Ansar al-Sharia compound.
Loyal brigades targeted
After storming the Ansar al-Sharia compound, protesters made their way to the headquarters of Rafallah Sehati, an official brigade of the Libyan defence ministry.
It was not immediately clear who had started the shooting.
Ismail Salabi, leader of the Rafallah Sehati brigade, which is credited with securing the nation for parliamentary elections, told , that his vehicle was shot at about 4km from the base.
Salabi described the attack as an "assassination attempt".
Mohamed al-Megaryef, the National Assembly chief, urged the demonstrators to withdraw from the bases of loyal brigades, citing the Rafallah Sehati and February 17 Brigades and Shield Libya.
The Libyan military chief of staff and defence minister both alluded to "Gaddafi loyalists" as being responsible for the raid.
The wounded, however, dismissed such allegations, saying instead that the government and the loyal brigades responded in a violent manner reminiscent of the days of Gaddafi.
The apparent defeat of Ansar al-Sharia across Benghazi marks an extraordinary transformation in a country where the authorities had seemed largely powerless to curb the influence of militia groups armed with heavy weapons.
Nevertheless, Ansar al-Sharia and other militia groups have bases elsewhere in eastern Libya, notably around the coastal city of Derna, known across the region as a major recruitment centre for fighters who joined the wars in Iraq, Afghanistan and Syria.
Friday night's raids followed protests earlier in the day when around 30,000 protesters from the Save Benghazi group marched through the city's al-Kish Square, which was a key battleground in the uprising that overthrew Gaddafi.
At the same time, about 3,000 supporters of Ansar al-Sharia group gathered in the same area.
Waving black Islamic flags, they chanted against the anti-Islam video as also cartoons of Prophet Muhammad published by a French satirical weekly.