The United Nations chief, Antonio Guterres, has ended a mission in Libya with “heavy heart” amid mounting fears of a full-blown war after renegade General Khalifa Haftar ordered his troops to launch a military assault on the country’s capital.

Armed clashes took place on Friday near Tripoli as eastern forces loyal to Haftar continued their advance towards the city, which is controlled by the UN-backed Government of National Accord (GNA) and protected by an array of militias.

“I still hope it is possible to avoid a bloody confrontation in and around Tripoli,” Guterres wrote on Twitter after meeting Haftar in his stronghold, the eastern city of Benghazi.

“The UN is committed to facilitating a political solution and, whatever happens, the UN is committed to supporting the Libyan people,” Guterres said.

According to Al-Arabiya TV, Haftar, told Guterres that his operation towards Tripoli will continue until “terrorism” has been defeated.

The UN chief had travelled to Libya this week to help organise a national reconciliation conference planned for later this month and aimed at drawing a plan for delayed elections.

But in a surprise move on Thursday, Haftar ordered his self-styled Libyan National Army (LNA), which is allied to a parallel administration based in the east, to advance towards the capital.

I leave Libya with a heavy heart and deeply concerned. I still hope it is possible to avoid a bloody confrontation in and around Tripoli. The UN is committed to facilitating a political solution and, whatever happens, the UN is committed to supporting the Libyan people. — António Guterres (@antonioguterres) April 5, 2019

The UN Security Council on Friday called on Haftar’s forces to “halt all military movements” after holding an emergency closed-door meeting.

Libya, which was plunged into chaos following NATO-backed removal of long-time ruler Muammar Gaddafi in 2011, has for years been split between the GNA in Tripoli and a rival government in the east allied to Haftar.

Haftar’s LNA troops on Thursday took the town of Gharyan, about 100km south of Tripoli, putting them closer than ever before to militias allied to the GNA.

They further moved north coming as close as 40km to Tripoli by taking the village of Suq al-Khamis after some fighting, a resident and an eastern military source told Reuters news agency.

Later on Friday, the LNA said they had taken control of the areas of Qasr ben Ghashir and Wadi al-Rabie on the southern outskirts of Tripoli, near the former Tripoli International Airport, closed since a city battle in 2014.

There was no independent confirmation. Fathi Bashagha, the Tripoli interior minister, later told Ahrar TV his forces had retaken the old airport while there were clashes in the Qasr ben Ghashir area.

Earlier on Friday, LNA forces failed to take a checkpoint about 30km west of the capital. They were pushed back by pro-GNA militiamen from the coastal town of Zawiya after a “short exchange of fire”, AFP news agency reported, citing an unnamed security source.

Traffic was flowing normally past the so-called Gate 27, which lies astride the coastal road to Tunisia, on Friday morning, an AFP correspondent reported.

In another setback, forces allied to the GNA took 145 LNA fighters prisoner in Zawiya and 60 vehicles were confiscated, a commander told Reuters. An LNA source confirmed 128 had been captured.

Tripoli-allied forces took 145 troops allied to the eastern forces and confiscated dozens of vehicles in the town of Zawiya [Hani Amara/Reuters]

This came after militias in western Libya vowed to confront Haftar’s attempt to seize Tripoli.

Al Jazeera’s Mahmoud Abdelwahed, reporting from the capital, said that forces from Misrata are also believed to have joined Tripoli-allied troops to the south of the capital and are advancing southwest towards Gharyan.

Also on Friday, a militia known as the Joint Tripoli Protection Force based in the area and smaller towns around the Libyan capital announced it would also deploy to repel Haftar’s offensive.

“There are reports of confrontations between Haftar’s forces and UN-backed government forces on the outskirts of Gharyan,” Abdelwahed said.

International powers urge de-escalation

Several governments and organisations have urged de-escalation, including those known to be Haftar’s key backers such as France and the United Arab Emirates (UAE).

The two countries, along with the UK, Italy and the United States, said in a joint statement on Friday that “military posturing and threats of unilateral action only risk propelling Libya back toward chaos”.

Maja Kocijancic, a spokeswoman for the European Commission, said the bloc is “deeply concerned by the military build-up that is underway in Libya and the escalatory rhetoric which seriously risks leading to an uncontrollable confrontation”.

Matteo Salvini, Italy’s interior minister, warned that the stability along the southern rim of the Mediterranean Sea was in danger, with Algeria also in turmoil following the uprising against its longtime ailing president.

Russia, which has thrown its support behind Haftar in the past, distanced itself from the offensive.

Dmitry Peskov, a spokesman for President Vladimir Putin, denied any support for Haftar and emphasised the need “to avoid actions that would lead to the resumption of bloodshed”.