Militias, many comprised of former rebels who fought in Libya's eight-month civil war that toppled Moammar Gadhafi in 2011, have mushroomed in size and power in the last two years. The government has so far failed to bring the well-armed groups under state control, though efforts have been made to encourage enrollment in the country's still weak police and army.
The militias blocked access to the ministries in an attempt to push parliament to pass a contentious law that would prevent members of Gadhafi's regime from serving in senior government posts. Libyan lawmakers approved the measure over the weekend, with guns still drawn on the streets.
The militias remained outside the ministries for several more days to demand that the law be applied quickly. The groups had a list of several ministers they wanted removed, including Libya's prime minister. He has angered militias by calling on them to join the government's security forces, vowing to take a hard stance against armed groups that do not fall into line.
Employees could be seen going to work again at the ministries after militias ended their siege on Saturday. An official at the Foreign Ministry told The Associated Press that the situation had returned to normal Sunday, with the country's foreign minister and his deputy meeting with other top diplomats on their first day back at work.
On Friday, scores of militiamen descended on an anti-Islamist rally in the nation's capital, kicking and beating protesters who had taken to the streets after a call for demonstrations against the unruly militias.
Rallies also took place in the eastern cities of Benghazi and Tobruk. Hundreds of activists denounced the armed groups and what they described as political maneuverings by the nation's Muslim Brotherhood in relation to the new law.
A day later in Benghazi, the country's second largest city, a police station was bombed, according to a security official there. No injuries were reported.
All officials spoke anonymously because they were not authorized to speak to reporters.
The Interior Ministry said it has 400 "highly trained" policemen to beef up security in Benghazi, and that around 2,000 police cadets are graduating in the coming days to help secure the city.
Benghazi was the site of an attack last September on the U.S. consulate that killed Ambassador Chris Stevens and three other Americans.