Open this photo in gallery:

Fighters loyal to Libya's internationally recognized government celebrate after regaining control over Tripoli, on June 4, 2020.AYMAN AL-SAHILI/Reuters

Forces allied with Libya’s UN-supported government said Thursday they regained control of all of Tripoli’s entrance and exit points after taking back the airport, claiming that the siege by rival troops trying to capture the capital for more than a year has effectively ended.

The announcement marks another blow to the east-based Libyan Arab Armed Forces, led by commander Khalifa Hifter who has recently lost several strategic spots in western Libya. Late on Wednesday, the Tripoli-allied troops said they had retaken Tripoli International Airport, which fell to Mr. Hifter’s forces last year.

“In these historic moments, we announce that all municipal boundaries of Tripoli have been liberated,” Mohamed Gnono, spokesman for the Tripoli-allied forces, said in a video posted on social media.

Mr. Hifter’s military command said it was “relocating” forces out of Tripoli in response to calls for the resumption of the UN-brokered political process, but that the battle for the capital “is not over.”

Libyan Prime Minister Fayez Sarraj vowed the Tripoli forces would press on, apparently spurning the cease-fire talks.

“We will in no way give him the opportunity for negotiations,” Mr. Sarraj said of Mr. Hifter. “We will continue this struggle until the enemy is totally removed,” he added after a meeting with Turkish President Recep Tayyip Erdogan in Ankara, Turkey.

Mr. Erdogan said Turkey would step-up its co-operation with Mr. Sarraj’s government, including to drill for natural resources in the eastern Mediterranean, based on an economic agreement signed last fall. “We will never abandon our Libyan brothers,” Mr. Erdogan said.

The developments illustrate how much the tide of war has turned in Libya – just months ago, Mr. Hifter was the one who had the upper hand and refused to sign a cease-fire agreement.

Mr. Hifter’s campaign to capture Tripoli has morphed into an escalating proxy war between Turkey and Russia. Last month, the U.S. military accused Russia of deploying 14 fighter jets to eastern Libya to help Mr. Hifter’s forces, saying the move was part of Moscow’s goal of establishing a foothold in the region that could threaten NATO allies. U.S. and Libyan officials have also accused Russia of deploying mercenaries from the Wagner Group, a Kremlin-linked private company, in key Libyan battlegrounds. Russia has repeatedly denied playing any role in Libya’s fighting.

U.S. Ambassador to Libya Richard Norland told reporters on Thursday that the recent manoeuvres and weapons shipments by Turkey and Russia could set the stage for either a “full-blown regional war” or “an opportunity to de-escalate.”

He expressed hope that the intensified diplomatic activity and the case-fire talks, announced this week by the U.N., could help the sides reach an agreement.

“What makes it different now is that the escalation is in such a dangerous stage that cooler heads can and should prevail,” he said.

The UN spoke with Mr. Hifter’s military delegation on Wednesday and said it soon planned to speak with the Tripoli-based government.

“Our focus, the mission’s focus, is on the talks that have begun to re-establish the cease-fire,” said U.N. spokesman Stephane Dujarric.

In a sign that a broader diplomatic push was under way, Mr. Hifter and 13 of his close advisers left Cairo on Thursday, after two days of meetings with senior Egyptian and Libyan officials, according to Cairo airport officials speaking on condition of anonymity because they were not authorized to talk to the media.

Since 2015, Libya has been divided between two governments, one in the east and one in the west. Mr. Hifter’s campaign to capture Tripoli has killed hundreds of civilians and displaced over 150,000, by UN estimates.

The Tripoli forces said two medics were killed Thursday near their field hospital close to the Libyan capital. Mr. Gnono, the spokesman, blamed Mr. Hifter’s fighters, saying they had booby trapped areas before pulling out. The UN had raised alarm last week about civilians being killed and wounded by improvised explosive devices left in residential areas of Tripoli.

Tripoli’s International Airport was damaged by heavy fighting in 2014, forcing its closure. For years, flights were diverted to the Mitiga airport, which has repeatedly halted operations over the past year because of shelling blamed on Mr. Hifter’s forces.

After Wednesday’s recapture, photos of bombed-out Libyan commercial planes at the airport were posted on the official Facebook page of the Tripoli-allied forces. Videos of the government-affiliated militias celebrating outside the airport circulated online.

“The fall of Tripoli airport is a symbolic achievement,” said Claudia Gazzini, a senior analyst with the International Crisis Group. “It is the base of Hifter’s forces since more than a year and one of the main conflict lines in the capital.”

But Ms. Gazzini said it was too early to call Mr. Hifter’s offensive finished, given how the conflict has seesawed. “There is still room for a continued offensive. It all depends on how much military backing Hifter’s backers are willing to give him.”

In recent months, the Tripoli militias, boosted primarily by Turkish drones and deployments of Syrian mercenaries, have retaken some key towns surrounding the capital. Mr. Hifter’s forces, supported by Russia, Egypt, Saudi Arabia and the United Arab Emirates, have responded with increased airstrikes.

The escalation comes as Libya’s coronavirus case count steadily increases, stoking fears a major outbreak would quickly overwhelm the war-scarred health system. Libya has about 170 confirmed cases but testing remains scarce.

The North African country slid into chaos after the ouster and killing of longtime dictator Moammar Gadhafi in 2011.

Our Morning Update and Evening Update newsletters are written by Globe editors, giving you a concise summary of the day’s most important headlines. Sign up today.

Follow related authors and topics

Authors and topics you follow will be added to your personal news feed in Following.

Interact with The Globe