Armed groups have ended a nearly two-week siege of Libya's foreign and justice ministries in the capital after reaching a deal with the government, the Libyan justice minister has said.
"Those who were at the two ministries have handed over the two ministries to a committee formed by the government and the General National Congress and have now departed," Salah al-Marghani, justice minister, said on Saturday.
The armed groups surrounded the ministries in Tripoli late last month to press parliament to pass a law banning anyone who held a senior position under the late leader Muammar Gaddafi from holding office in the new administration.
The move came after hundreds of people rallied on Friday to denounce the use of violence by militias. The activists accuse the Muslim Brotherhood of trying to seize power by force.
Prime Minister Ali Zeidan had announced on Wednesday there would be a cabinet reshuffle "in the coming days," against the backdrop of the country's latest political crisis, sparked by the besieging of the two ministries.
"There will no doubt be a ministerial reshuffle in the coming days," he told reporters.
The move comes as hundreds of leaders in the oil-rich east agreed to join forces to defend their territory against similar attacks.
A commander of a militia group stationed at the gates of the vacant foreign ministry said late on Saturday that the building been handed over to a committee made up of members of parliament and leaders connected to the armed protests.
The Supreme Security Council, the umbrella group of former rebel fighters under the command of the interior ministry that has led the seige, is now better armed and more powerful than the police.
"The protesters had retreated because [some of] their demands were realised," the commander told the Reuters news agency.
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 foreign ministry and the justice ministry had been handed over to a government committee.
'Unfair and too sweeping'
Rights groups and diplomats criticised the measure banning former Gaddafi officials, saying its terms were too sweeping and could cripple the government.
They also argued it was unfair because it made no exception for those who had spent decades in exile and had been instrumental in the toppling of Gaddafi 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 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 Gaddafi 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 television 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.
British oil company BP said it is withdrawing some non-essential staff from Libya after Britain's government warned about deteriorating security in the capital Tripoli.
"We are taking some non-Libyan staff out of the office in Tripoli following advice by the foreign office," the spokesperson said. The foreign office advises against all travel to parts of Libya.
The British embassy said on Friday it was cutting staff due to growing unrest in the capital, where armed groups seized two government ministries in late April to press demands on parliament, heightening fears clashes could break out in Tripoli.