The US State Department has recommended that Americans leave Libya immediately in its latest travel warning amid worsening unrest in the North African country.
The department said on Tuesday that the security situation in Libya "remains unpredictable and unstable", with crime levels high in many parts of the country. The advisory came amid reports newly elected Libyan Prime Minister Ahmed Maiteg had escaped unharmed after his residence was attacked by gunmen.
The State Department added that various groups also had called for attacks against US citizens and US interests in Libya.
"Due to security concerns, the Department of State has limited staffing at Embassy Tripoli and is only able to offer very limited emergency services to US citizens in Libya," the travel warning said.
"Because of the presumption that foreigners, especially US citizens, in Libya may be associated with the US government or US NGOs, travellers should be aware that they may be targeted for kidnapping, violent attacks, or death," it added.
There was no move yet to evacuate diplomats from the embassy.
The department in December warned US citizens against all but essential travel to Tripoli, and against any travel outside the Libyan capital.
Earlier on Tuesday, the United States announced it was deploying an amphibious assault ship with about 1,000 marines and several helicopters off the coast of Libya in case the US embassy must be evacuated.
The USS Bataan was to be in the area "in a matter of days," said a defence official, who spoke to the AFP news agency on condition of anonymity, adding it was a "precautionary" measure.
However, other anonymous US defence officials told the Associated Press news agency that Bataan had moved into the Mediterranean Sea, but was not expected to be positioned off Libya's coast. It would head to Libya only if needed.
The United States also has available 250 marines, seven tilt-rotor Osprey aircraft and three refuelling aircraft in Sigonella, Italy.
The US security measures followed an attack on Libya's parliament, the General National Congress, on May 18 by armed groups, and came as the leader of rebel group Ansar al-Sharia in Libya's second-largest city of Benghazi warned the United States on Tuesday against interfering in the country's affairs.
Ansar al-Sharia is designated in the United States as "a foreign terrorist organisation" and is accused of orchestrating the 2012 attack on the US Consulate in Benghazi in which US Ambassador Chris Stevens and three other Americans died.
The US maintains its embassy in Tripoli but closed its consulate in Benghazi after the attack.