Libyan forces under Khalifa Haftar battled their way to the south of Tripoli on Friday, prompting the UN Security Council and the G7 to demand a halt to the military advance on the capital.
Haftar, commander of the self-proclaimed Libyan National Army (LNA), launched an offensive on Thursday to take the capital, held by a UN-backed unity government and an array of militias.
The lightening assault was ordered as UN Secretary-General Antonio Guterres was in Libya for a visit aimed at cementing a political deal on holding elections.
After meeting with Haftar in the eastern city of Benghazi, Guterres said he was leaving "Libya with a deep concern and a heavy heart" and voiced hope that a "bloody confrontation" could be avoided.
Shortly afterwards, LNA forces clashed with a pro-government alliance less than 50 kilometres (30 miles) south of the capital, a unity government source said.
Haftar's press office confirmed there had been "violent fighting on the edge of Tripoli with armed militias".
Halt all movements
After a closed-door emergency meeting in New York, the Security Council called on Haftar's forces to halt their advance and warned that those responsible for re-igniting the conflict will be held responsible.
The appeal for Haftar to halt his offensive was unanimously backed by the council, including Russia, which has supported the strongman.
The council "called on LNA forces to halt all military movements" and "on all forces to de-escalate military activity," said German Ambassador Christoph Heusgen, who holds the council presidency.
UN envoy Ghassan Salame told the council that Haftar made clear to Guterres during the Benghazi meeting that he had no intention of halting his campaign, diplomats said.
G7 foreign ministers meeting in the French resort town of Dinard urged an immediate halt to "all military activity and movements toward Tripoli", warning that civilians were in danger.
LNA forces briefly took over the ruins of a destroyed airport but were driven out by fighters from the capital, government interior minister Fathi Bachagha told Libya's Al-Ahrar television station.
"The fighting is currently taking place in the Gasr Ben Ghechir region" south of the airport, he said.
LNA spokesman Ahmad al-Mesmari said five fighters from his group had been killed in clashes over the past 24 hours, but insisted that it had made "an important step forward".
Earlier in the day, LNA forces were pushed back from a key checkpoint less than 30 kilometres from the capital, checking their offensive.
Pro-government militiamen from the coastal town of Zawiya, west of Tripoli, retook the base after a "short exchange of fire", a source said on condition of anonymity.
The head of the UN-backed unity government, Fayez al-Sarraj, visited the checkpoint on Friday accompanied by military commanders.
Time has come
The Zawiya militia is one of dozens that have proliferated since the 2011 overthrow of dictator Moamer Kadhafi and are variously aligned with Sarraj's government and a rival administration in the east backed by Haftar.
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.
Haftar said "the time has come" to take Tripoli in an audio message released on Thursday, pledging to spare civilians and "state institutions".
The United States and its allies issued a joint statement urging "all parties to immediately de-escalate tensions".
Russia called for "all possible efforts to fully resolve the situation with peaceful political means".
Analysts say the advance by Haftar's forces comes at a key moment as the UN bids to get elections back on track after an abortive effort last year.
"The risk of a flare-up has increased," said Jalel Harchaoui, a researcher at Clingendael Institute in The Hague.
"Capturing Tripoli... remains a possibility" for Haftar, with the support he receives from Saudi Arabia and its allies Egypt and the United Arab Emirates, he said.