Forces loyal to Libya's UN-backed unity government seized the headquarters of a rival militia on Wednesday in a third day of intense fighting for control of Tripoli.
The capital has seen exchanges of rocket and artillery fire between unity government forces and a militia loyal to former prime minister Khalifa Ghweil.
Libya has experienced years of violence and lawlessness since the NATO-backed ouster of longtime dictator Moamer Kadhafi in 2011, with rival parliaments and governments vying for influence and militias fighting over territory and the country's vast oil wealth.
Since taking power from Ghweil's administration in March 2016, the Government of National Accord has secured the backing of powerful militias in the capital, but some districts remain outside its control.
Ghweil refuses to recognise the GNA's authority.
Overnight, government forces launched an assault on his headquarters in the Guest Palace, a complex of luxury villas in the city centre, and overran it after heavy fighting.
"It's over. Ghweil's forces have pulled out and GNA forces have taken control of the area," a witness told AFP.
A security source confirmed the militia's withdrawal, but had no immediate word on any casualties.
It was the third straight day of fighting between government forces and the militia, who are mainly drawn from Ghweil's hometown, third city Misrata.
Gunfire and explosions were heard from multiple parts of the capital.
A rocket hit the Al-Khadhra Hospital without causing any casualties, a medic said.
Overnight, gunmen stormed the headquarters of Al-Nabaa television, a privately owned channel known for its Islamist leanings, witnesses said.
The channel remained off the air on Wednesday.
The fighting brought life in the capital to a standstill, with schools and shops closed.
- 'Outlaw groups' -
UN Libya envoy Martin Kobler on Tuesday tweeted an appeal for an "immediate ceasefire", saying the fighting put civilians at "grave risk".
Clashes erupted in the neighbourhoods of Hay al-Andalus and Gargaresh on Monday evening, prompting the government to deploy tanks.
Tripoli's GNA-allied police said security forces in Tripoli were battling "outlaw groups that are destabilising security and inciting chaos".
"It was our duty to eradicate them and fight them to stabilise the capital," the police added.
Heavy fighting has also rocked the east of Libya where forces loyal to military strongman Khalifa Haftar announced their recapture of two key oil ports on Tuesday.
Haftar's forces mounted a day-long assault by land, sea and air to retake the ports of Ras Lanuf and Al-Sidra which had been seized by a rival, Islamist-led force earlier this month.
Haftar and his ally, Libya's elected parliament in the eastern city of Tobruk, are hostile to the GNA, the result of a 2015 UN-backed deal.
They accuse the GNA of supporting the Benghazi Defense Brigades, a group including Islamist fighters which seized the oil ports in early March. The GNA denies any connection to fighting in the east.
The clashes in Tripoli are "the result of the abysmal failure by the GNA and the international community to implement the security arrangements in the Libyan Political Agreement," analyst Mohamed Eljarh of the Atlantic Council told AFP.
"None of the arrangements set out in the agreement was implemented on the ground in Tripoli," making military escalation and violence "the only viable option that can address the problem of militias and insecurity in the capital," he said.
"Such an option can never be considered a success due to the impact on civilians and infrastructure."