The German foreign ministry issued a statement urging its citizens to "urgently leave the city and the region of Benghazi", saying it had information about "a specific, immediate threat to Western citizens in Benghazi".
Britain's warning sparked an angry response from Libya's government, which said there was "no new intelligence" to justify such concerns in the eastern city that was the cradle of the uprising that ousted dictator Moamer Kadhafi in 2011.
The alert out of London came just hours after British Prime Minister David Cameron warned that last week's deadly attack on a gas complex in Algeria was only one part of what would be a "long struggle against murderous terrorists" around the world.
"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 in London said in a statement.
British National Security Adviser Kim Darroch was in Tripoli on Wednesday but the Foreign Office insisted the visit had nothing to do with the new threat.
The Netherlands also repeated its warning against travel to Benghazi and surrounding areas, with a foreign ministry spokesman telling news agency AFP: "This means it would be better if they left."
Air Malta announced it was cancelling its two scheduled flights to Benghazi on Thursday because of Britain's warning.
The company said it was monitoring the situation "in real time" and was so far not cancelling its next flight, scheduled for Tuesday.
Libya's deputy interior minister, Abdullah Massoud, expressed his "astonishment" at the warnings and said his country would be demanding an explanation from Britain.
"We acknowledge that there are security problems in Benghazi and that there have been for several months, but there is no new intelligence that could justify this reaction from London," the minister said.
"On the contrary. We are now in the process of establishing our authority in the east and in all of Libya, and the security forces are organising themselves little by little and are more and more visible on the ground."
Since its pivotal role as the springboard for the uprising, Benghazi has emerged as a hub for jihadist groups.
The alert came a day after US Secretary of State Hillary Clinton warned of the challenge posed by rising militancy following the Arab Spring, as she testified before Congress about September's bloody attack on the US mission in Benghazi.
US Ambassador to Libya Chris Stevens and three other Americans were killed when dozens of heavily armed Al-Qaeda-linked militants overran the compound and a nearby CIA-run annex.
Britain had closed its mission in Benghazi around the same time and updated its official advice to warn against travelling there and indeed to most of Libya.
Fears over security in the city were reinforced earlier this month when the Italian consul was shot at in his car, although he escaped unhurt.
Last week's attack on the BP-run In Amenas gas plant in Algeria, in which at least 37 foreign hostages and one Algerian hostage were killed, has sparked fresh concerns about rising Islamist extremism across north Africa.
There have been reports that the hostage-takers entered Algeria from Libya and used weapons left over from Kadhafi's arsenal, although Libyan Prime Minister Ali Zeidan has denied the claims.