The State Department on Tuesday told US citizens in Libya to leave immediately, warning that the security situation in the country was "unpredictable and unstable."
A travel warning issued late Tuesday says the Libyan government has not adequately built a military and police force, and that many military-grade weapons are in the hands of civilians. It says this includes anti-aircraft weapons that could be aimed at civilian aircraft.
The warning says foreigners in Libya are generally presumed to be associated with the U.S. government and may be the targets of kidnappers or killers.
Earlier Tuesday, a Pentagon official said the aircraft carrier USS Bataan is being deployed to the Mediterranean in case an evacuation of Americans from Libya is needed.
Armed groups stormed the Libyan congress last week and Islamist militants have warned the U.S. not to interfere.
The US decision comes amid ongoing controversy over a September 2012 attack on the US consulate in Benghazi in which four Americans, including ambassador Christopher Stevens, were killed.
Gunmen attacked the home of Libya\’s new prime minister on Tuesday.
An aide to Ahmed Maiteg said the prime minister and his family were in the house at the time but escaped unharmed.
Maiteg, 42, was elected prime minister earlier this month to replace Abdullah al-Thani, who resigned in April following an attack on his family.