The United States evacuated its Libyan embassy staff under air cover Saturday as they faced a "real risk" from fierce fighting around Tripoli airport, Secretary of State John Kerry said.
The announcement came hours after the country's interim government warned the clashes between militia vying for control of the strategic airport were threatening to tear Libya apart.
It was around 5:00 am (0300 GMT) when the evacuation began, with the sky over the capital filled with the sound of military jets and helicopters, an AFP correspondent reported.
A Libyan security source said the air operation was an escort for the convoy of embassy vehicles on the ground which headed westwards out of Tripoli overland for the safety of neighbouring Tunisia.
Fighting around the airport halted abruptly and the convoy sped out of the capital shortly afterwards, witnesses said.
The embassy was considered to be at risk as it is on the airport road, close to the scene of the fighting.
Only on Friday night, the government had warned the country could be torn apart by the clashes.
Calling for an end to the conflict around the airport, the government raised the spectre of "the collapse of the country" and "the destruction which could result from... endless war".
Kerry said Washington had ordered Saturday's evacuation "because of the freewheeling militia violence that is taking place in Tripoli".
"A lot of the violence is around our embassy -- but not on the embassy -- but nevertheless presents a very real risk to our personnel," he told reporters in Paris, where he was meeting European and Middle Eastern foreign ministers over the crisis in Gaza.
"We will return the moment the security situation permits us to do so. But given the situation... we want to take every precaution to protect our folks," Kerry said.
- Travel warning -
Signup to our newsletter and follow us on Facebook and Twitter!
International special envoys for Libya met with the UN in Brussels on Thursday and issued a statement calling the situation in the North African country "critical".
It urged all sides to "demonstrate a willingness to compromise" and hoped all parties "will agree to enter into an inclusive political dialogue" after a ceasefire.
The US State Department issued an updated travel warning cautioning Americans against travelling to Libya, and urging all those there to "depart immediately".
Pentagon spokesman Rear Admiral John Kirby said the "embassy staff was driven in vehicles to Tunisia" in a five-hour operation which went off smoothly and was closely monitored from the air by "F-16's, ISR assets and an Airborne Response Force with MV-22 Ospreys".
Fresh clashes had broken out Friday between rival Libyan militias battling for control of the airport, the target of 13 days of shelling that have disrupted air links to the outside world.
The main international airport has been shut since the fighting erupted on July 13, in violence that has killed at least 47 people and wounded 120, according to health ministry figures.
The clashes, the most violent since the overthrow of dictator Moamer Kadhafi in 2011, started with an assault on the airport by a coalition of groups, mainly Islamists, which has since been backed by fighters from third city Misrata.
Memories are still raw for many Americans of the 2012 militant attack on a US mission in eastern Benghazi when the ambassador Chris Stevens and three other American personnel were killed.
Several countries including Saudi Arabia and Algeria closed their embassies in Libya earlier this year, while Turkey followed suit on Friday, announcing that, like the Americans it was "temporarily suspending" its diplomatic operations.
Shortly after the US evacuation began, Internet connections in Tripoli and other cities in western Libya were lost, but a spokesman for the national telecommunications company said this was a breakdown in the service.
The lack of security in the capital has led to banks and filling stations closing, paralysing a city in which power cuts are increasingly frequent.
Water supplies are regularly cut and with a shortage of fuel and gas canisters for domestic use, daily life in Tripoli is particularly hard.
Scores of people demonstrated on Friday to protest at worsening living conditions and to call for an end to the violence.