Britain, Germany and the Netherlands have urged all of their citizens to leave the eastern Libyan city of Benghazi due to a specific threat to Westerners.

Britain has said it is aware of a "specific and imminent" threat to Westerners in the Libyan city of Benghazi and urged British nationals to evacuate, giving no details of the nature of the danger.

"We are now aware of a specific and imminent threat to Westerners in Benghazi, and urge any British nationals who remain there against our advice to leave immediately," the Foreign Office said in a statement on Thursday.

The Foreign Office declined to give more details about the nature of the threat in the city, cradle of the 2011 revolution that toppled former Libyan leader Muammar Gaddafi.

The Dutch Foreign Ministry warned its citizens to avoid Benghazi and the area to its east, saying the security situation was uncertain and that there was a risk of violence.

"All journeys, including for transit, and stays in certain regions, specifically Benghazi and the region to its east, are advised against," the ministry said on its website.

The German Foreign Ministry declined to give any further details to explain its warning. Berlin had warned Germans since last week's deadly attack in Algeria of a heightened risk of violence or kidnapping for Westerners across North Africa and countries bordering the Sahara.

An attack on the US mission in the eastern city in September last year killed four Americans, including the US ambassador, part of a wave of violence targeting foreign diplomats, military and police officers.

Libya has been awash with weapons since the fall of Gaddafi, and its institutions have struggled to rein in armed groups keen on ensuring they receive what they see as their fair share of power for helping to oust Gaddafi.

Benghazi in particular has been the scene of power struggles between various armed rebel groups.