A British navy ship has evacuated British nationals from Libya, according to the UK Defence Ministry, as worsening security there is forcing thousands to flee.

The HMS Enterprise, which had been on a Mediterranean deployment, on Sunday evacuated 110 people, mostly British, from the capital Tripoli, Michael Aron, British ambassador to Libya, said on Twitter.

It arrived in Malta on Monday carrying the Britons, including 30 children, 12 infants, four pregnant women and one elderly and sick person, according to another statement by Aron via Twitter.

Britain is also planning to temporarily suspend its embassy operations in Libya, the Foreign Office said.

Sunday's operation resembles one conducted in 2011 during the uprising that toppled long-time ruler Muammar Gaddafi, when a Royal Navy ship evacuated foreigners.

Aron has said he has "reluctantly" decided to leave due to the worsening local clashes.

Libya has suffered chronic insecurity since Gaddafi's overthrow, with the new government unable to check armed groups that helped to remove him as well as the rise of conservative religious groups.

Fighting between the rival factions has forced the closure of Tripoli's international airport, while the Ansar al-Sharia is battling army special forces in the eastern city of Benghazi.

On Sunday, fighting for control of the airport left at least 22 people dead and oil depots hit by shells caused mass fires in Tripoli.

In the past week, many countries have ordered their citizens to leave and, in some cases, have evacuated them.

Between 100 and 300 Britons are thought to be in Libya.

Many British consular staff were evacuated last Monday.

"Fighting has intensified in Tripoli, including around the British embassy compounds," a Foreign Office spokesman said.

"In the light of the deteriorating security situation, we are taking steps temporarily to suspend operations at the British embassy in Tripoli after the planned assisted departure of British nationals."

"We advise against all travel to Libya and urge British nationals in Libya to leave through commercially available means."