The Libyan government, following a mass public demonstration of support, is taking tentative steps to consolidate military force more than a year after rebels toppled Muammar Gaddafi.
The many militias that still control the streets are the clearest challenge to the central authority which was obliged to do deals with many of them to provide security.
The killing of four Americans including the ambassador in a militant attack on the US consulate in Benghazi two weeks ago (11 Sept.) has spurred the administration in Tripoli to take action and channel public frustration with the militias.
Many Libyans, especially young people, came out to mourn Ambassador Chris Stevens after his death.
Thousands of Libyans marched in Benghazi in protest against the Islamist militias that Washington blamed for the attack.
Edicts to curb unsanctioned groups have had little or no effect in the past, but that was before the strong public showing in the streets.
The army chief Yussef al-Mangoush and the national assembly leader Mohammed Magarief have ordered that all illegitimate militias be removed from compounds and their weapons handed to the national army.
Magarief said this applied to all camps outside state control.
A spokesman for the Defence Ministry said several evictions and handovers had been done peacefully.
However, protesters moving in on one compound they thought harboured an Islamist militia but which was the base of a powerful pro-government group, came under fire, and 11 people were killed.
Many of the fault lines in Libya are tribal, others sectarian. Fundamentalist groups want strict Islam and no democracy.
Factions which co-existed in Libya under dictatorship want the upper hand now.
That is why the country is increasingly being seen as a potential new Iraq or Afghanistan.
In July, Libyans held free and fair elections, and many say their first wish is security. Without that they cannot build new institutions.
Showing anger against extremists demonstrates desire for a stronger state, under rule of law.