At least 31 people have been killed and 285 hurt in Tripoli after a demonstration calling on unruly militias to leave the Libyan capital turned violent, the health minister says.
The militias are holdovers from the 2011 uprising that ousted dictator Muammar Gaddafi and are a powerful force in the increasingly lawless North African country.
The government, at a news conference, called for a ceasefire after Friday's demonstration turned into a deadly confrontation between groups of gunmen.
"We call on all armed factions to cease fire so the government can take the necessary measures to restore calm in the capital," it said in a statement read by Culture Minister Hassan al-Amin.
Health Minister Nureddin Doghman told reporters the clashes left 13 dead and 114 others wounded.
But less than an hour later he told private channel Libya al-Ahrar that the toll had risen to 31 killed and 285 wounded and could still rise.
Violence erupted when gunmen fired at hundreds of demonstrators carrying white flags from inside villas in the southern Tripoli district of Gharghour where the Misrata militia has its headquarters.
The shooting sparked a violent response in which armed men assaulted the villas and set them on fire.
It was not clear how many died in the demonstration or how many were killed in the assault. "It's total confusion," a health ministry said.
Prime Minister Ali Zeidan said armed demonstrators were involved in the clashes and that the security forces had not intervened "so as not to complicate the situation."
Zeidan, who was abducted briefly by armed men in October, had warned last week of the possibility of foreign powers intervening in Libya unless chaos ends, and called on Libyans to rebel against militias.
"The people must take to the streets ... and support the building up of the army and police," he said last Sunday, in an appeal at rallying his campaign against militias.
On Friday Sadat al-Badri, president of Tripoli city council, insisted that the demonstrators were unarmed.
"It was a peaceful protest," he said, and declared three days of mourning in the capital.
Badri, whose council had called for the protest, told AFP that shots fired at demonstrators came from inside the militia headquarters.
"We're going to announce a general strike and launch a civil disobedience campaign until these militias leave," he said.
Hundreds of people carrying white flags in a sign of peace, Libya's colours and singing the national anthem had assembled in the capital's Meliana Square.
"No to militias," their banners read. "Yes to the police and army."
The protesters, among them children, then marched to the Misrata militia headquarters in Gharghour to press their demands when gunmen inside fired into the air to scare them off.
When the crowd continued to approach the building, the gunmen started firing at them, said an AFP correspondent who saw two wounded, including one hit in the stomach.
A leader of the militia from Misrata, Libya's third city which saw some of the most brutal fighting in the 2011 uprising, told private television Al-Naba that demonstrators had opened fire first.
The mufti, Sadok al-Ghariani, appealed to residents to go home to avoid further bloodshed, while the health ministry called for blood donations to Tripoli hospitals.
The march was sparked by violence on November 7 in which the Misrata militia also played a central role and which terrorised Tripoli residents and illustrated again growing instability in Libya.
Residents of Tripoli frequently demonstrate against the militias, who have rejected government demands to turn in their weapons or join the national security forces.