The US state department has warned any American citizens in Libya to leave the country immediately.
It said the situation in the country remained unpredictable and unstable.
On Tuesday, the US said it was sending a warship carrying around 1,000 marines to the region for any possible evacuation of American officials.
Concern over the situation in Libya has increased after a renegade general launched an assault against Islamist militias in Benghazi.
Gen Khalifa Haftar last week urged the judiciary to appoint a crisis government to oversee new elections after accusing Libya's leaders of "fostering terrorism".
Dozens of state bodies have pledged their support for Gen Haftar.
But the government called his assault an "attempted coup" and ordered the arrest of those taking part.
The unstable situation has led the US to call for its citizens to leave the troubled country as soon as possible.
"US citizens currently in Libya should exercise extreme caution and depart immediately," the state department said on Tuesday.
It warned against all but essential travel to Tripoli and against any travel outside the Libyan capital.
An American defence official told the AFP news agency that one of its warships was also being sent to the region in case US staff needed to be evacuated from Libya.
The USS Bataan, which carries around 1,000 US Marines and several helicopters, was to be in the area "in a matter of days," the official said, adding that it was a "precautionary" measure.
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.
Mr Maiteg, 42, was elected prime minister earlier this month to replace Abdullah al-Thani, who resigned in April following an attack on his family.