Image caption The BP move follows UK advice about uncertainty in Libya

Oil giant BP has withdrawn some non-essential staff from operations in Libya following UK government advice about uncertainty in the country.

BP described the withdrawal as a "precautionary measure", adding that it would monitor the security situation.

The Foreign Office withdrew British embassy staff from the capital, Tripoli, last week.

Gunmen have besieged the justice and foreign ministries recently, demanding that Gaddafi-era officials be expelled.

The gunmen blocked the buildings two weeks ago, parking pick-up trucks with anti-aircraft guns outside. The siege was lifted by Sunday and employees at both ministries were back at work.

Parliament passed a law last week barring Gaddafi-era officials from political office.

BP said in a statement: "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.

"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."

On Friday, the Foreign Office said some embassy staff in Libya had been withdrawn in response to "ongoing political uncertainty".

It said it was temporarily withdrawing a "small number" who work with Libyan ministries, while the UK embassy remains "open as usual", including for consular and visa services.

The Foreign Office currently advises against all but essential travel to Tripoli and against all travel to other parts of Libya, such as the eastern city of Benghazi.