Spain was one of several western nations on Sunday to warn their citizens to leave Libya, where intensifying fighting between militias was threatening to destabilize the country.
The country's foreign affairs ministry "very strongly" recommended its nationals leave the country given the "serious worsening" of the security situation in the country.
Consular services in the country could also be limited, the embassy said on its website.
Britain, Germany, France, the Netherlands and the United States have also called on their citizens to get out of Libya
"The situation is extremely unpredictable and uncertain," the German foreign ministry said. "German nationals are at increased risk of kidnapping and attacks."
Two weeks of fighting between militias in Libya's capital Tripoli have left 97 people dead.
The United States evacuated staff from its Libyan embassy under air cover on Saturday as they faced a "real risk" from fierce fighting around Tripoli airport, US Secretary of State John Kerry said.
The airport was closed on July 13th following clashes between armed groups in the area.
Britain later updated its advice to warn against travel to Libya, and told those already there to leave.
"Due to the ongoing and greater intensity of fighting in Tripoli and wider instability throughout Libya, the Foreign and Commonwealth Office (FCO) advise against all travel to Libya," the ministry's website said.
"British nationals in Libya should leave now by commercial means."
Britain's embassy will remain open but with reduced staff, and its ability to provide consular assistance "is very limited," the Foreign Office said.
High terror threat
The British ministry warned of a high threat of terrorism, noting that a number of foreign nationals have been shot dead in recent months.
It told those still in Libya, believed to number between 100 and 300, to avoid demonstrations or large crowds and to "keep a low profile".
The US announcement that it was evacuating its embassy came hours after Libya's interim government warned that the clashes between militia vying for control of the strategic airport were threatening to tear the country apart.
Czech, Maltese and Austrian foreign ministries have ongoing advice not to travel to Libya.
Sweden, Denmark, Finland and Norway have all also advised against travel, while Sweden has also told its citizens to leave the second city of Benghazi.
Spain's foreign ministry "very strongly" recommends that all Spaniards leave Libya "immediately" and Switzerland has warned citizens that it would find it difficult to rescue them should the situation deteriorate.
Belgium on July 16 told nationals to leave the country "immediately" and Turkish citizens were advised to leave on July 24th, a day before its government suspended operations at the Tripoli embassy.
Austria, Italy and Portugal have all warned nationals against travelling around the country, with Austria saying that the risk of terrorist attack was particularly high in Benghazi.