Europe moved ahead Thursday with plans that would allow states to restore internal border controls in case a massive wave of migrants overwhelms the continent's passport-free travel area.
EU interior ministers vowed at a special meeting to protect one of Europe's most celebrated achievements, the Schengen zone which allows unfettered travel across 25 states, as they responded to populist-driven fears that unrest in north Africa will trigger a massive exodus.
"There was a clear position from every minister: the free movement of people is one of the union's key achievements and we have to maintain and safeguard this," said Hungarian Interior Minister Sandor Pinter, who chaired the talks.
At the same time, most backed a European Commission plan to allow, as a last resort and under strict conditions, the temporary return of border guards to deal with a sudden surge in migration, or if an EU state fails to control its frontier with non-EU nations.
"A very wide consensus, if not near unanimity, was reached on the commission proposals," said French Interior Minister Claude Gueant.
A wave of migrants risking their lives to cross the Mediterrenean, combined with the rise of far-right parties, has raised the spectre of a return to internal border controls in the Schengen travel area much appreciated by EU citizens and tourists alike.
Fifteen of the EU's 27 states backed the changes. Cyprus was the only vocal opponent during the closed-door talks although Belgium, Spain and Malta voiced reservations, a European Union diplomat said.
"Some countries say we need to restore border controls. That is certainly not the right response," said Belgian Migration Minister Melchior Wathelet.
He said the EU should instead focus on striking deals to return illegal migrants to their home countries and reinforce borders with non-EU nations.
Denmark came under a barrage of fire from European lawmakers over its sudden decision on the eve of the talks to restore customs controls at its borders with Sweden and Germany within the next few weeks.
"If Denmark wants to question the consensus in Europe on this issue, then it should withdraw from the Schengen accord in which case Danish citizens would quickly feel the disadvantages," said the head of the conservative European People's Party, Joseph Daul.
The European Commission is reviewing the decision and said it would "not hesitate to take action" should it conclude that Denmark breaches EU rules.
Danish Integration Minister Soren Pind defended the move, saying it was aimed at preventing cross-border crime and drug trafficking, and said the EU needed a frank discussion about the "dark side" of open frontiers.
Pind said his country was merely deploying customs agents to check cars for crimes such as drug trafficking, and that the goal was not to check passports.
"I think that when this model is studied carefully, everyone will see that it is, if I may quote Shakespeare, much ado about nothing," he said. "We don't want to bring back the borders."
The EU's external borders have been under strain for some time in Greece, where the debt-stricken government has struggled with an influx of migrants sneaking in from neighbouring Turkey, with guards sent in from other EU states to help manage the frontier.
But since the Arab Spring, France and Italy have lobbied intensively for the temporary return of internal borders - after Rome forced the issue by handing temporary residency permits to 20,000 migrants allowing them to travel freely throughout Schengen.
"Very few people so far have come to Europe but enough of course to make us think about how we receive these people and how we deal with this," said EU home affairs commission Cecilia Malmstroem.