Western powers, concerned by continuing political instability in Libya and galvanised by a recent car bombing at the French embassy, are reducing their diplomatic staffs in Tripoli and warning citizens about visiting the country.
On Friday, Britain announced it was temporarily withdrawing some staff from its embassy.
"Given the security implications of the ongoing political uncertainty, the British embassy is temporarily withdrawing a small number of staff, mainly those who work in support of government ministries which have been affected by recent developments," a Foreign Office spokesman said.
"The embassy is open as usual, including for consular and visa services."
But the British Council cultural agency said it was closing its Libyan office until next week for the same reason.
"Due to the uncertainty of the situation in Tripoli we will be closing to the public until and including Thursday 16 May 2013," it said on its Facebook page.
Gunmen surrounded the Libyan foreign ministry on April 28 and the justice ministry two days later to demand the passing of a law excluding from office collaborators of the ousted and murdered dictator Moamer Kadhafi.
There has also been violence in Libya's second city Benghazi, the cradle of the 2011 uprising that toppled Kadhafi, with bomb attacks on Friday damaging two police stations but causing no casualties.
Authorities blame radical Islamists for the violence in Benghazi, including a deadly attack in September against the US consulate in the city that killed Ambassador Chris Stevens and three other Americans.
On Thursday, the US State Department issued a travel warning, saying it "strongly advises against all but essential travel to Tripoli and all travel to Benghazi, Bani Walid and southern Libya, including border areas and the regions of Sabha and Kufra."
And a day earlier, US authorities also said they were reducing embassy staffing in Tripoli, saying the security situation had deteriorated as a result of the seizure of government buildings by former rebels.
Britain, France and the United States issued a joint statement on Wednesday calling on "all Libyans to refrain from armed protest and violence during this difficult time in the democratic transition".
Britain and France led the creation of a NATO no-fly zone in Libya in 2011 when the rebellion against Kadhafi began.
On April 23, a car bomb exploded outside the French embassy, wounding two French guards and causing extensive damage.
The French government reduced the number of personnel at the mission, which continues to function despite the damages.
Meanwhile, the French school in Tripoli remains closed until security around its building can be guaranteed, its directors said.
And the German embassy has closed its doors, and its staff moved to secure quarters elsewhere in Tripoli, a Western source said.
As far back as January, London referred to a potential threat on its embassy in Tripoli and called on its citizens to leave Benghazi after identifying what it called a "specific and imminent threat to Westerners."
Meanwhile, Libyan Prime Minister Ali Zeidan announced on Wednesday a cabinet reshuffle "in the coming days," against the backdrop of the country's latest political crisis, sparked by former rebels besieging two ministries.
The announcement came days after the National General Congress adopted a law that would bar Kadhafi-era officials from holding government posts.
The draft law caused a stir among the political elite, as senior members of the government could be affected, among them Zeidan himself and GNC president Mohamed Megaryef.
Both were diplomats under Kadhafi before joining the opposition in exile.
Zeidan did not say whether the reshuffle would be to apply the new law or to give posts to members of the militias, who claim to have been promised five portfolios, including those of defence and interior.
Militiamen withdrew pick-up trucks mounted with machineguns and anti-aircraft weapons from outside the foreign and justice ministries on Wednesday, but some were demanding Zeidan's resignation.
On Friday, protesters in military uniform were still outside the two ministries, an AFP reporter said, while in the afternoon dozens rallied in the centre of the capital to defend the "legitimacy" of the government.
Protesters held up banners that said the government should not be driven out "under the threat of arms."