Violent protests in eastern Libya have set in motion a movement to take back the nation from dozens of militias born from the revolt against strongman Moammar Gadhafi. Since the dictator's demise, Libya has been beholden to men with guns.

The transitional state is weak, and it depends on the militias to help secure the streets. The state has now promised to integrate the militias into the security forces.

Gunfire rang through the air over the weekend as demonstrators stormed the base of a government-aligned militia. The protesters were emboldened by their raids on the headquarters of three other groups not backed by the government, including the extremist group Ansar al-Sharia. Clashes ensued and demonstrators burst into this last base, looting the weapons and forcing out the brigade.

Now those Islamist fighters of Rafallah al-Sahati are in their homes unsure of their fates. Libya's president announced that all government-aligned militias will now report to the army chief of staff. All other armed groups must disband. Rafallah al-Sahati is sanctioned by the government.

"Without us, there will be no security," says Mohammed Gharabi, the commander of Rafallah al-Sahati. "We've asked the state to take control multiple times, but each time the Libyan government says it can't. There is no army, no police."

A Slow Dissolution

It is a reality that the transitional government acknowledges. The complications of disbanding groups that battled against Gadhafi are immense. Do commanders of brigades now start as lowly soldiers? Are they integrated as groups or individuals?

"The first step is that those brigades that do not recognize the authority of the state are illegitimate," says Saleh Joud, deputy head of national security.

But he says the problem can't be solved overnight. First, military leaders will take control of the brigades, he says, and slowly the fighting groups will be dissolved.

The biggest mistake, he says, is to isolate them and treat them as criminals.

"We do not want to repeat Gadhafi's mistake by exporting them to other countries to fight," Joud says. "They are our sons and they are our responsibility."

In the capital, militias were given 48 hours from Sunday to evacuate government property or be forced out. After Tripoli, the army will move to other cities to do the same.

Security Apparatus A Patchwork

Residents of Libya have struggled to understand which groups are the legitimate authorities. The security apparatus is a patchwork of militias, military and police that all operate independently. In Benghazi, the only people who appear to secure the streets are the militiamen.

Only after mass demonstrations on Friday demanding the dissolution of armed groups did Libya's army appear in the streets. They didn't look much different from the militias; they're a ragtag mix of paramilitary groups and troops that defected from the former regime.

Libyan Army Chief of Staff Yousef Mangoush says the protests are an opportunity for the state to clean house.

"There is no doubt that it's a strong initiative that came from the streets; it's proof that the street wants the establishment of the state. We will take advantage of that to end those militias," Mangoush says.

Even if it appears to be just promises for now, that's enough to reassure many residents here.

Gharabi, the Rafallah al-Sahati commander, says if the people want him and others gone, they will return to their homes.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.