Tripoli is controlled by a loose alliance of militias of different political and religious factions, and clashes between them are an almost daily occurrence.
The fighting that erupted in the city on Thursday continued on Friday, with shooting heard throughout the day as most residents stayed at home.
UN envoy Martin Kobler in a statement called on forces involved in the violence to stop immediately "and for wisdom to prevail".
"It is completely unacceptable for armed groups to fight to assert their interest and control, particularly in residential areas, terrorising the population," Kobler said.
He said the United Nations was in contact with parties on the ground to urge "an immediate end to this fighting".
At least eight people were killed on Thursday and Friday, a source at the Al-Khadhra hospital in Tripoli said.
Five years after Libya's 2011 revolution that toppled longtime dictator Moamer Kadhafi, the country remains embroiled in violence and political chaos as the militias and two rival governments vie for power.
A UN-backed Government of National Accord took up office in March with the hopes of re-establishing central power and stemming a jihadist threat from the Islamic State group.
It was intended to replace the rival administrations but has failed to win a vote of confidence from the parliament in Tobruk while the Tripoli-based GNA considers it illegitimate.
The GNA suffered a fresh setback in October after the rival Government of National Salvation seized key offices in the capital.
The reasons for the latest clashes are not clear, but pro-GNA militias late Friday announced the end of an "operation" aimed at chasing a group of "extremists".