Libya's army chief resigned Sunday, a day after clashes killed 31 people in Benghazi, the country's highest political authority said, announcing plans to integrate ex-rebels into the security forces by end of 2013.
To calm the situation after Saturday's clashes involving former rebels, the General National Congress announced the resignation of General Yusef al-Mangoush, who has been criticised for delays in forming a national army.
GNC vice president Jomaa Atiga also said the government was being given two weeks to submit a plan to dissolve armed groups linked to the defence and interior ministries and to integrate their members individually into the regular security forces.
Atiga told a press conference in Tripoli that authorities would have until the end of 2013 to implement the plan.
The decision provides for the dissolution of "all illegitimate armed groups", "including by use of force", he said.
The GNC also declared three days of mourning for the victims of Saturday's violence in the eastern city of Benghazi.
The clashes flared after dozens of demonstrators, some armed, tried to force the powerful "Shield of Libya" brigade from its barracks in Benghazi, an AFP correspondent reported.
They encircled the headquarters and called on regular security forces to step in, saying they wanted rid of armed militias in the city.
The Shield of Libya is mostly made up of rebels who battled dictator Moamer Kadhafi in 2011, and it is formally under defence ministry control.
The official LANA news agency quoted a source at Al-Jala hospital in Benghazi -- cradle of the 2011 uprising that ousted Kadhafi -- as saying the fighting had killed at least 31 people and wounded 100 more.
The dead were buried on Sunday to cries of "the martyrs' blood was not spilled in vain", as several hundred mourners gathered in Al-Hawari cemetery near central Benghazi.
The funerals took place in a calm atmosphere, although several young men vowed to meet later to protest against the "massacre of civilians by militias".
Before Mangoush's resignation, the GNC called in a statement for calm and restraint on all sides "for the benefit of the national interest".
Signup to our newsletter and follow us on Facebook and Twitter!
Libya's post-Kadhafi authorities, who have still not managed to form a professional army and police corps, have in the past called on the Shield of Libya to intervene in various tribal disputes across the country.
The brigade is the largest of the ex-rebel militias. Wissam Ben Hamid, a former rebel in his forties known for his ties to Islamists, commands it.
Prime Minister Ali Zeidan said late Saturday that the Shield of Libya had evacuated its Benghazi headquarters and the regular army had taken control of the building and heavy weapons there.
Regular troops would also take control of three other buildings used by the brigade in Benghazi, an army spokesman said on Sunday.
But the brigade may not be disbanded immediately.
Mohammed al-Maadani, an academic from Benghazi, told AFP he thought such a move was unlikely.
"The state cannot do without these ex-rebel brigades" for the time being, he said.
Maadani said "the authorities have trusted the former rebels with missions that the army is unable to perform at the moment, such as monitoring borders".
"But every time it is the state that loses its credibility by giving legitimacy to these ex-rebel groups that the population has rejected," he added.
In October, Benghazi residents forced other militias from their bases.
The government has been unable to disarm and disband the ex-rebel militias that still control areas of the country.
Violence has been on the rise in Benghazi in recent months, with several attacks on Western-linked targets and security officers.
Army chief Mangoush had been accused of defending and legitimising armed groups made up of former rebels. In May, the GNC had already decided to replace him but said it had yet to decide on how to appoint his replacement.