Some 400 prisoners have escaped from a facility near the Libyan capital Tripoli amid deadly violence between militia groups in the city.

A police officer near the scene said the detainees were able to force open the doors and leave.

Clashes between militias in the city have led Libya's UN-backed government to declare a state of emergency.