Forces loyal to Libyan strongman Khalifa Haftar were pushed back from a key checkpoint less than 30 kilometres from Tripoli, checking their lightning advance on the capital, a security source said yesterday.
Pro-governmental militiamen from the coastal town of Zawiya, west of Tripoli, retook the base after a "short exchange of fire", the source said on condition of anonymity.
The advance by Haftar's forces on Thursday, which came as the United Nations prepares to convene a conference later this month on organising delayed elections, prompted UN chief Antonio Guterres to voice his "deep concern".
Guterres was in Tripoli for talks with the head of the UN-backed unity government, Fayez al-Sarraj, when the offensive was announced. He was due to meet Haftar in eastern Libya later yesterday.
The UN Security Council was also to hold an urgent meeting on the crisis as Western governments appealed for restraint.
Traffic was flowing normally past the checkpoint yesterday morning. Just a single armoured vehicle was seen. The allegiance of its occupants was not immediately clear.
The Zawiya militia is one of dozens that have proliferated since the overthrow of veteran dictator Moamer Gaddafi in a Nato-backed uprising in 2011 and are variously aligned with the UN-backed unity government in the capital and a rival administration in the east backed by Haftar's forces.
Most of the pro-Haftar fighters who briefly captured the checkpoint late on Thursday were rival militiamen from the town of Sabratha further west along the Mediterranean coast.
Dozens of them were captured and their vehicles seized, the security source said.
The UN Security Council was due to meet behind closed doors to discuss the crisis.
The United States and its allies issued a joint statement urging "all parties to immediately de-escalate tensions".