Libya will close its borders with Tunis and Egypt for five days as a security measure ahead of the country's two-year anniversary marking the ouster of Muammar Gaddafi, the prime minister said.

Ali Zeidan announced the closure during a news conference as part of list of security measures following concerns about potential militia violence surrounding the celebrations.

"As of midnight on February 14th until the 18th, no one will be allowed to cross the Libyan borders between Egypt or Tunis as a security precaution," he told reporters on Monday.

On February 17, Libyans will mark two years since an armed revolt ended Gaddafi's rule and celebrations are planned to begin on February 15.

But many Libyans, particularly those in the east, are urging citizens to take to the streets to protest the government's inability to so far provide security by disarming militias or moving towards writing a constitution.

Security is particularly a concern in the east of the country where violence towards foreigners and police assassinations have become a regular occurrence by unknown extremist militias.

On January 25, the United Kingdom urged their nationals to leave Benghazi citing a "specific and imminent" threat to Westerners days after a deadly attack by Islamist militants in neighbouring Algeria.

Flights to Libya were suspended by Lufthansa and Austrian Airlines until after the February 17 citing "tensions on the ground" in the country.

Many international organisations, including the United Nations mission in Libya and Western embassy staff will be on lockdown starting on February 14 as a safety measure.

Security in Tripoli and Benghazi have been increased in the past week, with several random check points by Libyan police and militias affiliated with the interior ministry popping up on all major roads.

"We will focus on tightening security at airports also in order to avoid any issues that will derail the celebrations," Zeidan said.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.