Updating an earlier toll, emergency services told Al-Ahrar television a child was among the nine dead and that 25 other people -- including civilians -- were wounded, several of them seriously.
A gunbattle erupted late Thursday in Ain Zara, a densely populated neighbourhood of eastern Tripoli, between the Al-Radaa force and the Tripoli Revolutionaries Brigade, media reports said.
It lasted until the early hours of Friday before spreading to other areas.
Three civilians were killed and two wounded, ambulance services Osama Ali told Al-Ahrar television, adding they were taken to Tripoli Medical Center.
Sixty students were trapped by the fighting in university dormitories until they were evacuated by the ambulance service, said Ali.
The death toll was expected to rise since "we do not yet have information from private clinics in the area", he added.
The clashes were the latest flare-up in fighting that first erupted on June 10, but the civilian casualties were the first in the capital for months.
Images posted on social media show dozens of vehicles abandoned by drivers fleeing the violence in the middle of streets.
The unrest forced flights by Libyan Airlines and Alamia to be diverted from Tripoli's Mitiga airport to Misrata, around 200 kilometres (125 miles) east of the capital.
Libya has been gripped by insecurity since a NATO-backed uprising in 2011 toppled and killed dictator Moamer Kadhafi.