Clashes between backers of Libya's rival governments killed at least 23 people and damaged six hospitals in Tripoli on Saturday, sparking fears that a political crisis could spiral into a major new armed conflict.
Small arms fire and explosions rocked several districts of the capital overnight and into Saturday, when smoke could be seen rising from damaged buildings.
But cautious calm appeared to have returned on Saturday night, an AFP correspondent said.
The head of the government in Tripoli, Abdulhamid Dbeibah, posted a video of himself surrounded by bodyguards and greeting fighters supporting him.
In an updated toll, the health ministry in Tripoli said 23 people had been killed and 140 wounded in the fighting.
Six hospitals were hit and ambulances were unable to reach areas affected by the clashes, the ministry had said earlier, condemning "war crimes".
The two rival administrations vying for control of the North African country and its vast oil resources -- one based in the capital, the other approved by a parliament in the country's east -- exchanged blame.
The UN's Libya mission called for "an immediate cessation of hostilities", citing "ongoing armed clashes including indiscriminate medium and heavy shelling in civilian-populated neighbourhoods".
The US ambassador to Libya, Richard Norland, said in a statement that Washington "condemns" the surge in violence, urging an "immediate ceasefire and UN-facilitated talks between the conflicting parties".
News agency Lana said actor Mustafa Baraka had been killed in one of the neighbourhoods hit by fighting, sparking anger and mourning on social media.
Dbeibah's Government of National Unity said fighting had broken out after negotiations to avoid bloodshed in the western city collapsed.
Dbeibah's government, installed as part of a United Nations-led peace process following a previous round of violence, is challenged by a rival government led by former interior minister Fathi Bashagha.
Bashagha, who is backed by Libya's parliament and eastern-based military strongman Khalifa Haftar, says the GNU's mandate has expired.
But he has so far been unable to take office in Tripoli, as Dbeibah has insisted on only handing power to an elected government.
Dbeibah's government accused Bashagha of "carrying out his threats" to seize Tripoli by force.
Dbeibah's GNU said negotiations had been underway to "hold elections at the end of the year to resolve the political crisis", but that Bashagha had "walked out at the last moment".
Bashagha denied such talks had taken place, and accused Dbeibah's "illegitimate" administration of "clinging to power".
Local media reported later Saturday that a group of pro-Bashagha militias that had been making their way to the capital from Misrata had turned back.
Emadeddin Badi, a senior fellow at the Atlantic Council, warned that the violence could quickly escalate.
"Urban warfare has its own logic, it's harmful both to civilian infrastructure and to people, so even if it isn't a long war, this conflict will be very destructive as we have already seen," he told AFP.
He added that the fighting could strengthen Haftar and those close to him.
"They stand to benefit from western Libya divisions and have a better negotiating position once the dust settles."
Bashagha was appointed in February by the parliament, which was elected in 2014 and is based in the eastern city of Tobruk, but he has been unable to impose his authority in Tripoli.
Initially ruling out the use of violence, the former interior minister has since hinted that he could resort to force.
Last week, he called on "Libyan men of honour" to drop their support for Dbeibah's "obsolete and illegitimate" administration.
In July, clashes between rival groups in Tripoli left 16 people dead, including a child.
It was the deadliest violence to hit the Libyan capital since Haftar's ill-fated attempt to seize it by force in 2019 and 2020.