Oil giant BP said Sunday it had pulled some non-essential overseas staff out of Libya because of concerns about the political situation, following the lead of the US and British embassies.

In a statement, BP said the decision to withdraw fewer than a dozen people was a "precautionary measure" following advice from the Foreign Office (FCO).

Tensions have risen in Libya since ex-rebels besieged two ministries at the end of last month in a row over a law to ban officials who served under slain dictator Moamer Kadhafi from holding office.

In Friday, Britain and then the United States announced they were withdrawing some diplomatic staff from the country.

"Following FCO advice given to us by the British embassy in Tripoli, and purely as a precautionary measure, we have brought non-essential overseas staff out of Libya for the time being in a phased reduction of numbers," the BP statement said.

"Our Libyan staff remain and the office continues to operate. Fewer than a dozen people are affected.

"We will continue to monitor the security situation and move people back in to Libya when it is considered safe to do so."