The State Department spokeswoman said embassy staff would return to Tripoli once it was deemed safe. Until then, embassy operations would be conducted from elsewhere in the region and Washington.
Security in Libya is an especially sensitive subject for the United States because of the Sept. 11, 2012, attack on the U.S. mission in Benghazi, in which militants killed Ambassador Chris Stevens and three other Americans.
Read MoreUkraine: What's the big disruption?
The attack also brought political fallout for President Barack Obama, with Republicans saying his administration did not provide sufficient overall security, did not respond quickly to the attack and then tried to cover up its shortcomings.
Ed Royce, Republican chairman of the House Committee on Foreign Affairs, told CNN on Saturday the administration needed to get "more engaged on the ground with the factions in Libya'' to help bring the violence under control.
"I think they're on the right track (now) but late into the game in terms of trying to bring factions together and use U.S. leverage in order to try to work this out,'' Royce said.
A Libyan militant suspected of involvement in the 2012 attack, Ahmed Abu Khatallah, was captured in Libya last month and brought to the United States. He has pleaded not guilty.
But three years after Gaddafi's demise, Libya's transition to democracy is faltering, and its fragile government and nascent armed forces are unable to impose authority over the brigades of former fighters.
Many ex-fighters on the government payroll as semi-official security forces, but often pay little heed to the central government, each brigade claiming to be a legitimate force and the successors of the 2011 revolution.
Heavily armed, they have sided with competing political forces vying to shape the future of Libya in the messy steps since the end of Gaddafi's four-decade rule.
Libya's Western partners fear the OPEC oil-producing country is becoming increasingly polarized between two main groupings of competing militia brigades and their political allies.
One side is grouped around Zintan and their Tripoli allies, the Qaaqaa and al-Sawaiq brigades, who are loosely tied to the National Forces Alliance political movement in the parliament.
Opposing them is a faction centered around the more Islamist-leaning Misrata brigades and allied militias who side with the Justice and Construction Party, a wing of the Muslim Brotherhood.