Updated

Some 400 prisoners escaped from a jail in the Libyan capital, authorities said Sunday, as fighting between rival militias that has killed dozens of people forced the U.N.-backed government to declare a state of emergency in and around Tripoli.

The inmates overwhelmed guards and forced open the doors of the Ain Zara prison after riots broke out there, police said in a statement posted on Facebook. The prisoners included many supporters of the late Libyan leader Moammar Gadhafi who had been found guilty of killings during the 2011 uprising that ended his rule and plunged the country into chaos.

The fighting in Tripoli erupted last week when the Seventh Brigade, militias which hail from Tarhouna, a town about 40 miles (60 kilometers) south of Tripoli, attacked southern neighborhoods of the capital. The Tripoli Revolutionaries' Brigades and the Nawasi Brigade, militias which support the U.N.-backed government, have come to the city's defense.

At least 47 people, including civilians, have been killed, and another 130 have been wounded, the Health Ministry said.

The government declared a state of emergency in and around Tripoli, saying the fighting is "an attempt to derail peaceful political transition" in the country. The government said it "could not remain silent over the attacks on Tripoli and its suburbs, which is a violation of security in the capital and of citizens' safety."

U.N. Secretary-General Antonio Guterres has condemned the violence in and around Tripoli and called on all sides to abide by a U.N.-brokered cease-fire.

Libya is currently governed by rival authorities in Tripoli and the country's east, each of which are backed by an array of militias. Other armed groups have carved out fiefdoms across the country, many profiting from smuggling and extortion.

Elsewhere in Libya, a rocket fell on a camp for people displaced from the town of Tawergha, killing two people and wounding 15 others, according to the municipal council.

A powerful militia from the nearby city of Misrata drove Tawergha's residents from their homes during the uprising, accusing them of siding with Gadhafi's forces, which had used the town as a staging ground for attacks on the city. Many have been living in makeshift camps since then.