Armed clashes erupted in the centre of Tripoli on Tuesday, killing two, as gunmen traded anti-aircraft and heavy machinegun fire, witnesses said.
The fighting broke out at a building used as intelligence headquarters by the former regime of slain dictator Muammer Gaddafi which was surrounded by former rebel fighters who toppled him last year.
Massud al-Khadar, a member of a local militia, told AFP: "Two of our (fighters) were killed in the clashes which began this morning."
He said the violence started when a rival militia from Misrata attacked his group based near the former intelligence building.
Ex-rebels who remain organised in militia brigades are visible in many parts of the Libyan capital, and some have taken control of former government buildings, using them as headquarters.
But witnesses near the scene told AFP earlier that forces linked to the new government's interior ministry may have tried to retake the intelligence building on Tuesday, provoking a clash with the militia group that is currently occupying it.
While those reports could not be independently verified, the interior ministry declined to comment when contacted by AFP, saying only that it would comment on the clashes later Tuesday.
AFP sources said militiamen had blocked traffic from reaching the building, even as two ambulances tried to access the area of unrest, with witnesses reporting a number of injuries.
Many gunmen could also be seen circulating in the area and the situation remained chaotic, according to AFP reporters on the scene.
A vehicle belonging to a former rebel group based in the area and equipped with a microphone and loudspeakers was touring the neighbourhood's streets, urging residents who are not armed to leave.