A damaged police car is seen outside a security forces building that was attacked by a crowd of protesters in Benghazi in September (Reuters)

Germany and the Netherlands have joined Britain in urging their nationals out of the northeastern Libyan city of Benghazi because of unspecified threats against Westerners.

The German government issued an alert on its website saying it was "made aware of a specific, imminent threat to Westerners in Benghazi and therefore strongly encourages all German citizens to leave the city and region of Benghazi immediately".

Dutch foreign ministry spokesman Thijs van Son said: "Staying in this area is not to be advised."

The UK was the first to alert its citiziens of the danger because of a "specific and imminent threat".

An update on the Foreign Office travel advice bulletin for Libya says: "There is a high threat from terrorism [and] a threat of kidnapping.

"Following French military intervention in Mali, there is a possibility of retaliatory attacks targeting Western interests in the region. We advise vigilance," the travel advice says.

According to Benghazi lawmaker Saleh Gawdat, French doctors working in Benghazi hospitals have already left the city.

The Foreign Office said dozens of Britons were in Benghazi and were being contacted directly.

Libya's deputy interior minister Abdullah Massoud admitted to the BBC that security problems exist in the area but said Britain's response had been disproportionate. It risked increasing instability in the region, he said.

According to Adel Mansouri, principal of the International School of Benghazi, foreigners had been warned about a possible threat over recent days.

He said teachers at the school were given the option to leave but had decided to stay.

"We told the British ambassador we are staying, and we'll be in touch," said Mansouri, a Libyan-British dual national. "We don't see a threat on the ground."

Ibrahim Sahd, a Benghazi-based lawmaker and politician, said the warning could be linked to a government plan to reinforce security in the city that "might have worried the Westerners of a backlash".

Air Malta has cancelled flights to Benghazi and said it will review its position daily.

The British consulate in Benghazi closed in June 2012 after a convoy carrying the UK ambassador to Libya, Dominic Asquith, was hit by a rocket-propelled grenade in the city's streets.

Italy shut down its compound in Benghazi and pulled staff out of the country after the consul was targeted in a similar gun attack earlier this month.

In the worst episode of a string of attacks targeting western foreign mission in Benghazi, US ambassador Chris Stevens and three other Americans lost their lives.

The warning has also come days after the terrorist attack to a BP gas facility in Algeria, by the hands of Islamist militants that reportedly resulted in the death of 37 foreign nationals.

Terrorists said to have stormed the gas plant in retaliation for France intervention in Mali and carried the attack crossing the border from Libya.

Home to 1 million people, Benghazi is a one of Libya's main business hubs and the starting point of the country's uprising against late dictator Moammar Gadhafi in 2011.