Gunmen ended a nearly two-week siege of the Libyan Ministry of Foreign Affairs in the capital after reaching a deal with the government, its Supreme Security Committee said late on Saturday.
Meanwhile, in the oil-rich east, hundreds of leaders agreed to join forces to defend their territory against similar armed attacks.
A commander of an SSE group stationed at the gates of the vacant foreign ministry said it had been handed over to a committee made up of members of parliament and leaders connected to the armed protests.
The SSE is a group of ex-rebel fighters under the Libyan Ministry of the Interior, now better armed and more powerful than the police.
“The protesters had retreated because [some of] their demands were realized,” he said.
Foreign ministry officials were not immediately available to comment on the details of the deal.
Other media outlets quoted the justice minister as saying the Libyan Ministry of Foreign Affairs and the Ministry of Justice had been handed over to a government committee.
Armed groups surrounded the ministries in the capital late last month to press parliament to pass a law banning anyone who held a senior position under late Libyan leader Muammar Qaddafi from the new administration.
Rights groups and diplomats criticized the measure, saying its terms were too sweeping and could cripple the government.
They also said it was unfair because it made no exception for those who had spent decades in exile and had been instrumental in the toppling of Qaddafi nearly two years ago.
Parliament caved in and approved the legislation a week later, leading the armed groups — who say they are revolutionaries and not militia — to expand their list of demands, including the resignation of Libyan Prime Minister Ali Zeidan.
The growing tension between the groups and the government has alarmed federalists and other factions in the east, prompting their leaders to unite to defend their territory from a similar assault.
Representatives from these groups pledged on Saturday to revive the Cyrenaica Congress. Formed about a year ago to demand greater autonomy for the east, it sets out a manifesto for a federal Libya.
“We will not let Cyrenaica be ruled by the power of force,” said Ahmed Zubair al-Senussi, a distant relative of King Idris, who was deposed in a military coup led by Qaddafi in 1969.
Senussi will remain the symbolic head of the congress.
In addition to selecting a head and combining military forces, the leaders moved to start a TV channel for the region.
The eastern congress agreed to start work on June 1, when it will hold its first assembly in the city of Al-Baida.
For about 10 years after Libya became an independent state in 1951, the country was run along federal lines with three regions. Power was devolved to Cyrenaica, to the southern province of Fezzan and to Tripolitania in the west.