The powerful Islamist militia Washington blames for an attack on its Benghazi consulate was swept from its heavily fortified bases in Libya's second city in a mass popular uprising in support of the government early on Saturday. 
The action against Ansar al-Sharia appeared to be part of a coordinated sweep of militia headquarters buildings by police, government troops and activists following a mass public demonstration against militia units on Friday.
At least four people were killed and 34 wounded, hospital sources said, as militants fought demonstrators. Gunfire could be heard in the area before the fighters were forced out.
Looters carried weapons out of the vacated Ansar al-Sharia military base compound as men clapped and chanted: "Say to Ansar al-Sharia, Benghazi will be your inferno."
Ansar al-Sharia has been linked to the attack on the US consulate in Benghazi last week in which the US ambassador to Libya and three other Americans died.  Ten Libyan security personnel also died in the attack. Ansar al-Sharia denies involvement.
Chanting "Libya, Libya", "No more al Qaeda!" and "The blood we shed for freedom shall not go in vain!" hundreds of men waving swords and even a meat cleaver stormed Ansar al-Sharia's headquarters in Benghazi.
"After what happened at the American consulate, the people of Benghazi had enough of the extremists," demonstrator Hassan Ahmed said. "They did not give allegiance to the army, so the people broke in and they fled."
Demonstrators pulled down militia flags and set a vehicle on fire inside Ansar al-Shari's headquarters, the same building which once served as the base of former Libyan leader Muammar Gaddafi's security forces.
"This place is like the Bastille. This is where Gaddafi controlled Libya from, and then Ansar al-Sharia took it over. This is a turning point for the people of Benghazi," said Ahmed.
Adusalam al-Tarhouni, a government worker who arrived with the first wave of protesters, said several pickup trucks full of the group's fighters had initially confronted the protesters by opening fire. Two protesters were shot in the leg, he said.
"After that they got into their trucks and drove away," he said. Protesters had freed four prisoners found inside, he added.
As protesters left Ansar al-Sharia's headquarters, the crowd swelled, reaching thousands as it headed toward the Islamists' military base, which was shared with another militia group.
Protesters said the militiamen opened fire as they arrived and several people were wounded.
"We came as peaceful protesters. When we got there they started shooting at us," said Sanad al-Barani, a student who attended the protest. "Five people were wounded beside me. They used 14.5 mm machine guns."
After the crowd entered that compound, Libyan army trucks 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 into the camp and we didn't find anyone. We just took these Kalashnikovs," said one youth, holding rifles.
The demonstrators also took over a compound belonging to the Abu Slim brigade and another Ansar al-Sharia compound.
The apparent defeat of Ansar al-Sharia across Benghazi and the huge outpouring of public support for the government 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 Islamist militia have bases elsewhere in eastern Libya, notably around the coastal city of Derna, known across the region as a major recruitment center for fighters who joined the wars in Iraq, Afghanistan and Syria.
Thousands of Libyans had marched in Benghazi on Friday in support of democracy and against the Islamist militias that Washington blames for the assault on its consulate. Hundreds of Ansar al-Sharia supporters held their own protest.
Friday's "Rescue Benghazi" demonstration called for the government to disband armed groups that have refused to give up their weapons since the NATO-backed revolution last year.
"It's obvious that this protest is against the militias. All of them should join the army or security forces as individuals, not as groups," said Ahmed Sanallah, a student. "Without that there will be no prosperity and no success for the new Libya."
Although the main demands of the marchers did not mention the attack on the US consulate, it seems to have provided a strong impetus for the authorities to rally support behind the country's weak government.
US Ambassador Christopher Stevens was well liked, and many Libyans condemned the attack on the consulate. Some protesters' placards read: "We demand justice for Stevens" and "Libya lost a friend." Others had mixed views.
"I am out today to defend Benghazi. Killing the ambassador is a completely separate thing," said 26-year-old Amjad Mohammed Hassan, a network engineer. "I don't give a damn about the killing of the ambassador because the Americans offended the Prophet. I am just here for Benghazi."
Benghazi, which lies 1,000 km from Tripoli across largely empty desert, is controlled by various armed groups, including some comprised of Islamists who openly proclaim their hostility to the West and its allies in the region.
Some are identified by local people as being among those who were at the consulate protest last week. US officials have described the violence as a "terrorist attack."
Abu Al-Qaa, a demonstrator at the Ansar al-Sharia demonstration, said Stevens had been "preparing for the entry of American troops into Libya".
"The will of the Prophet was to expel infidels from Muslim lands so that Muslims prevail," he said. "Terrorizing your enemy is one of Islam's tenets."
Abu Al-Qaa added that he had fought US troops in Iraq where he was arrested, sent back to Libya and jailed for three years.
One banner at the Ansar al-Sharia demonstration read: "Day to rescue Benghazi or day to rescue America?"
What are your thoughts on Saturday's uprising? And, do you think there can be a 'new Libya' whilst the militias remain in place? Leave us your comments below!