Around 100 Britons have fled from Libya and are on their way to sanctuary in Malta amid increasing violence in the north African state.
The Foreign and Commonwealth Office (FCO) confirmed an evacuation mission involving the Royal Navy survey ship HMS Enterprise had left its mooring near the Libyan capital of Tripoli and was on its way to safety.
Staff at the UK embassy - shut down against a backdrop of deadly fighting between rival militias in Libya - are among those fleeing for Malta. It is being referred to by the FCO as an "assisted departure" rather than a "rescue" as commercial transport is still available for those seeking to leave the country.
An FCO spokesman said: "We have carried out an assisted departure and the vessel is leaving Libya with those on board.
"The majority of them are British."
The Plymouth-based HMS Enterprise moored just off the Libyan capital city of Tripoli and dispatched a smaller launch vessel to fetch the evacuees.
Between 100 and 300 Britons are believed to have been based in Libya.
Many of the consular staff were evacuated last Monday but the ambassador and core staff remained, although they will now also return to the UK.
Since the overthrow in 2011 of Colonel Muammar Gaddafi by rebels supported by British and French air strikes, the north African country has descended into a state of lawlessness as rival militias struggle for power and wealth.
In the last few days, sporadic fighting between rival militias has spread northwards in the capital Tripoli, including into the area where the British embassy is situated.
Tourists have been advised against all travel to the country and the Foreign Office said an assisted departure was being prepared.
Any Britons unable to take advantage of this opportunity to leave have been told they should find their way home on commercial flights, with limited departures from Misrata and Maitega airports.
On Wednesday, British Airways suspended flights to and from Tripoli up to and including Tuesday due to the security situation at the country's main international airport.
An FCO spokesman said it planned to temporarily suspend operations at the British embassy following the assisted departure. It said it would not be able to offer consular assistance after August 4.
HMS Enterprise's commanding officer, Cdr Mark Vartan, said: "This is a period of uncertainty for UK citizens based in Libya but we have been proud to play our part in enabling their move to safety.
"My ship's company have adapted to the challenge superbly, making as much space as possible and providing essential food, shelter and security for the journey."
Defence Secretary Michael Fallon said: "I thank the crew of HMS Enterprise for their support and professionalism in carrying out this important task."