At least three people have been killed in the Libyan city of Benghazi after military police and protesters took over several militia bases.
The violence followed a day of protests by tens of thousands of citizens demanding an end to the armed groups.
The bases include the HQ of the Islamist group Ansar al-Sharia, suspected of involvement in an attack on the US consulate in the city.
The deaths occurred during a standoff at the base of another group.
Witnesses say supporters of Ansar al-Sharia lined up outside its headquarters, in front of the crowd, waving black and white banners.
They fired into the air to try to disperse the protesters, but fled with their weapons after the base was surrounded by waves of people shouting "no to militias".
Buildings and a car were set alight and fighters evicted.
However, in a standoff outside the headquarters of the Sahaty Brigade in the city, three people were killed and at least 20 injured according to witnesses and officials.
Wave of hostility
The BBC's Rana Jawad in the capital Tripoli says the Sahaty Brigade is believed to be operating under the authority of the Ministry of Defence.
Officials in Tripoli have been appealing for calm, she says.
Senior Libyan officials say that while they welcomed the protests, people should differentiate between the rogue militias and honest rebel brigades that helped to secure the town in last year's uprising against Col Muammar Gaddafi.
Earlier, some 30,000 protesters marched through Benghazi calling for an end to the armed groups and a return to the rule of law.
There has been a wave of hostility towards the militias since US Ambassador Chris Stevens and three others Americans died in the 11 September attack on the Benghazi consulate.
"I don't want to see armed men wearing Afghani-style clothes stopping me in the street to give me orders, I only want to see people in uniform," said university student Omar Mohammed, who took part in the takeover of the Ansar al-Sharia compound.
Many Libyans have expressed outrage at the attack on the US consulate, which followed a protest triggered by an anti-Islam film made in the US.
Libya's interim government has since come under renewed and intense pressure to rein in well-armed extremist militia groups and force them to disband.
Friday's march was the largest seen in Benghazi - considered the heartland of Libya's uprising - since Col Gaddafi was deposed.
Armed militia groups which helped to defeat Gaddafi remain powerful in many parts of the country.
They are better armed and more numerous than Libya's official army, and there have been reports of militias intimidating and carrying out killings against rivals.
Earlier this week authorities in Libya arrested around 50 people in connection with the attack on the US consulate.