Libyan Prime Minister Ali Zeidan urged rival militias to stay out of Tripoli on Saturday in an attempt to keep the peace a day after the worst street fighting in the capital since the fall of Muammar Gaddafi killed more than 40 people.
Libya's government and weak armed forces are struggling to control militias, Islamist militants and other former fighters who refuse to surrender their arms two years after helping to oust Gaddafi in a NATO-backed revolt.
Friday's violence broke out when militiamen from the coastal city of Misrata opened fire on protesters who had marched on their brigade quarters in Tripoli to demand they leave.
Clashes spread to other parts of Tripoli and at least 42 people were killed, health officials said.
"I urge that no forces at all to enter Tripoli," Zeidan said in a public speech. "It would have negative and catastrophic consequences."
Misrata militiamen were still holed up in their base near Tripoli airport on Saturday in a standoff with government forces and armed local residents who had taken to the streets to try to force the group out of the city.
Gun battles erupted on Saturday to the east of the capital in Tajoura, where rival militias clashed at checkpoints set up to stop more Misrata gunmen entering Tripoli, Mohammad Sasi, a local member of Libya's congress said.
Authorities said there were wounded in the Tajoura clashes, but did have immediate details.
Tripoli has sought to bring the militias under control by putting them on the government payroll and assigning them to protect government offices. But gunmen often remain loyal to their own commanders and battle for control of local areas.
Strikes and armed protests in the east and the west of Libya by militia and tribal gunmen demanding payments or more autonomy rights have already shut much of the OPEC member's oil output for months.
A two-week protest at Mellitah port by members of the Berber minority ended on Saturday, raising hopes Libya can resume gas exports from the terminal, operated by Italy's ENI and the National Oil Corp, on Sunday.