Forces allied with the Libyan government took control of at least two powerful militias’ bases in the eastern city of Benghazi on Saturday after protesters overran the compounds in the early morning hours.

Libyan leader Mohamed Yusuf al-Magariaf told reporters Saturday night that all of the country’s militias had orders to come under the authority of a joint security apparatus, including the military and police, or be disbanded.

Magariaf, president of Libya’s General National Congress, spoke at a news conference just before midnight, after meeting with officials and militia leaders in Benghazi. A day earlier, clashes between protesters and militias left four people dead and dozens injured.

Those clashes followed a large-scale protest Friday in which thousands of people marched through the city demanding the dissolution of the militias that have run Libya’s streets in the absence of a strong central government and police force since a revolution ended the 42-year rule of Moammar Gaddafi last year.

Many Libyans have blamed extremist groups for the attack on the U.S. Consulate here on Sept. 11 that killed four Americans, including the U.S. ambassador. The groups have operated with relative impunity in the security vacuum that has prevailed since Gaddafi’s ouster and death.

On Saturday, fighters from a militia loyal to the government roamed the ransacked base of the Islamist militia Ansar al-Sharia, which many here have accused of leading the attack on the consulate.

“The ambassador was a good man. He ate with us. Even during the revolution, he was with us,” said Riziq, a fighter with a government-allied militia across the street that had moved in to guard the abandoned compound and who declined to give his full name out of fear of retribution from Ansar al-Sharia.

Shattered glass and debris covered the base, and the smell of charred wreckage hung in the air. Below ground, Riziq’s brigade had discovered a few windowless cells, which they claimed the extremist group had used in their exercise of vigilante justice.

“They don’t look at us, the Libyan people, as Muslims,” he said. “They would arrest people who drank alcohol and imprison them here. And they were treating foreigners badly.”

Down the street, fighters from the Zawiyah Martyrs Brigade, another Benghazi militia that according to its commanders has become fully integrated into the national army, stood guard with their gun trucks outside the Rafallah al-Sahati base, which protesters had also raided the night before.

Some of the fighters said that Rafallah al-Sahati, a group with conservative Islamist leanings, was known to be sheltering members of Ansar al-Sharia. Others said that the militia, which until recently controlled the city’s airport, was targeted simply because it had failed to comply with the national military command.

The line between Libya’s independent militias and the militias who say they operate under the command of Libya’s fledgling national army is a fine one, however. In a televised statement late Friday night, Magariaf said that the protesters had become confused about which militias lay within the government’s umbrella and which beyond it, adding that Rafallah al-Sahati was, in fact, in compliance with the government and had been unjustifiably raided.

A former member of the transitional government in Tripoli said this week that Rafallah al-Sahati fighters had been part of the Libyan convoy that accompanied an American rescue team to a villa where consular staff had taken cover in the early hours of Sept. 12, after the initial attack on the U.S. Consulate. A heavier attack with mortars and rocket-propelled grenades immediately followed the rescue team’s arrival, prompting allegations from the Libyan government that the attack was well planned.

It remains unclear whether any members of Rafallah al-Sahati are under investigation in connection with the attack.

The confrontation between protesters and the militia’s fighters on Friday night sparked a firefight, and Libyan television broadcast footage of injured men being rushed into hospital emergency rooms. The group’s leader, Ismail Salabi, was lightly injured, according to his brother-in-law.

It was also unclear Saturday where the ousted militias had gone or whether they would be allowed to return.

“We won’t let them, unless they’re involved in the national army,” said Essam al-Araby of the Zawiyah Martyrs Brigade.

Most of the militias that maintain bases along Brigade Street, the major Benghazi artery that was also home to Ansar al-Sharia and Rafallah al-Sahati, say they belong to the national army.

But the fighters, many of them in their teens, still wear mismatched sets of fatigues. And unrestrained gunfire, including the launch of a rocket-propelled grenade, greeted the return of the 1st Infantry Legion Brigade’s commander, Hamid Bilkhair. His fighters claimed he had been mysteriously kidnapped that morning.

“We want to emphasize the point that it was the people who entered the base, not the army,” Riziq said. But he said Ansar al-Sharia could very well return.

“They have heavy weapons,” he said.