Libya's army chief of staff has resigned after clashes in the eastern city of Benghazi killed 31 people, according to members of the national assembly.
Yussef al-Mangoush told the General National Congress, Libya's highest political body, that he would no longer continue in the job and the assembly accepted the resignation, members present at Sunday's closed-door session said.
Fighting erupted on Saturday after dozens of demonstrators stormed a base belonging to the Libya Shield brigade, a group of militias with roots in the rebel groups that fought in the country's 2011 civil war. They are tasked with maintaining security and aligned with the Defence Ministry.
The congress picked Salem al-Gnaidy, Mangoush's deputy, to fill the position until a new army chief is picked, Reuters news agency reported citing a member of the assembly.
The protesters were demanding that militias leave their camp and submit to the full authority of Libya's security forces.
Mohamed Belied, director of Benghazi’s al-Jala hospital, said on Sunday that the deaths were caused by gunshots and explosive fragments. Hospital officials also said that protesters made up most of the casualties.
Adel Tarhuni, spokesman for the Libya Shield, said one member of the brigade had died and another seven were wounded. He said there was a peaceful demonstration in front of the brigade's headquarters, before armed men infiltrated it.
In a statement on Sunday, Prime Minister Ali Zidan described the events as “sad and painful” and urged people to be cautious and exercise self-restraint.
Zidan said the protesters demanded that a checkpoint at the entrance of the town be removed and that members of the Libya Shield leave the camp so that the police and army could take over. He said full details would be announced when investigations were completed.
Ahmed Belashahr, a local activist, said: "People protested because they believe militias go against Libya's stability, which can only be achieved through a proper army and police."
Witnesses said some of the protesters came armed. The camp was believed to house dozens of Libya Shield militiamen, while the protesters who attacked their camp were estimated to number several hundreds.
Members of the Libya Shield abandoned the camp following the attack in a move designed to defuse tension, witnesses said.
The fighting was the latest episode of lawlessness to hit the North African country, which is going through a rocky transition after its bloody 2011 civil war.
Security remains elusive in the country, still abundant with weapons from the war and prone to outbreaks of violence over private and political affairs.
Last September, shortly after an attack on the US mission in Benghazi in which the American ambassador and three others were killed, the city saw a huge outpouring of public anger at the militias.
While some Libyans view the continued presence of militias as an obstacle to restoring security in the country, others believe they are playing a positive role in maintaining law and order while efforts to rebuilt a professional army and police force are under way.