"We call on diplomatic missions and foreign firms to return to Tripoli," the government of self-declared prime minister Omar al-Hassi said in a statement.
"Foreigners who reside in Libya enjoy the same protection the state offers to its citizens," it said.
On Friday gunmen broke into the residence of the Swiss ambassador in Tripoli and looted the uninhabited house, before chased away by security forces.
Three years after dictator Moamer Kadhafi was toppled and killed in a NATO-backed revolt, Libya is awash with weapons and powerful militias, and run by rival governments and parliaments.
Fajr Libya (Libya Dawn), a coalition of Islamist militias, seized Tripoli in August after weeks of deadly fighting with a nationalist group.
Signup to our newsletter and follow us on Facebook and Twitter!
The violence triggered an exodus of foreigners from the Libyan capital and prompted the closure of several embassies, with many relocating to neighbouring countries.
Hassi's government was installed at the end of August by the militias.
It is jostling for power with the internationally backed government of Prime Minister Abdullah al-Thani, formed after parliamentary elections in June.
After Tripoli fell to the Islamists, the Thani government and the parliament moved to the remote east of the country.
In November, two car bombs struck near the shuttered Egyptian and United Arab Emirates in Tripoli, where Italy is one of the few countries to keep an embassy open.