Thu, 16 Mar 2017 17:08 UTC
The deal, signed by the UN-backed Government of National Accord (GNA), local mayors and powerful militias from Tripoli and Misrata provides for an "immediate ceasefire."
The agreement calls for armed groups that do not recognize the GNA to leave Tripoli within 30 days.
According to GNA's Defense Ministry, the deal also demands the release of people arrested since fresh battle triggered on Monday.
The Thursday deal cements the UN-backed government's control over large parts of the capital. It also charges GNA forces with securing areas controlled by rival groups.
The city has been paralyzed amid exchanges of rocket and artillery fire between pro-unity government forces and rival militias, whose members are mainly from Misrata, the hometown of former prime minister Khalifa Ghweil.
The fresh battle saw pro-GNA forces expand their clout in the capital. The forces have taken several districts from rival militias, including groups allied with Ghweil.
On Wednesday night, violent clashes rocked the capital's southern Salaheddine district.
However, the city and its surroundings were quiet on Thursday morning following the overnight deal.
An inter-Libyan political deal, backed by the UN and signed in December 2015, gave rise to the GNA and called for armed groups to leave Tripoli and other Libyan towns.
The capital is home to dozens of militias. Since taking office, the GNA has secured the backing of several, but many parts of Tripoli remain out of its control.
The unity government wants to see heavy weapons withdrawn from the capital to allow its security forces to operate effectively.
On Tuesday, heavy fighting rocked eastern Libya, where forces loyal to General Khalifa Haftar, the military commander of Libya's eastern government, regained control of two major oil ports of Ras Lanuf and al-Sidra from a rival faction that had seized them earlier this month.
Haftar's forces do not recognize the UN-backed government. Haftar was an ally of Libya's former long-time ruler Muammar Gaddafi but joined the Libyan revolution against the dictator in 2011.
Libya has been rocked by violence since NATO military intervention that followed the 2011 uprising and led to the overthrow and death of Gaddafi. Rival governments were set up in Tripoli and eastern Libya in 2014.
Comment: The UN-backed GNA is an illegitimate farce, not supported by the Libyan people. Here's what Haftar, leader of the Libyan National Army in the east and who at least has the temporary support of the Libyan people, had to say:
Ahmed Al-Mismari, the spokesperson of Haftar's forces, claimed that some members of the UN-backed Presidency Council and High Council of State held secret meetings with leaders of Al-Qaeda to mastermind the attack on the oil crescent region by Benghazi Defense Brigades, according to Libya Observer.
In an extraordinary press conference, Al-Mismari said the meetings were held in Tripoli and Misrata and attended by President of High Council of State Abdul-Rahman Al-Swaihli, some members from the Presidency Council and some leaders of Al-Qaeda.
He said, "This is a coalition of all terrorist groups in western Libya against the Libyan National Army in the east." He also noted that their aim is political opportunism.
Al-Mismari also claimed that Al-Qaeda are competing for the control of Tripoli and oil ports to have more influence on the ground.
Moreover, Al-Mismari has previously accused Qatar and Turkey of supplying advanced military equipment to Benghazi Defense Brigades ahead of their military operation in oil ports.