SWITZERLAND - The government of Switzerland has pledged urgent diplomatic talks with its neighbours after a wafer-thin majority of the Swiss electorate voted to ignore the country's existing open border agreements with the European Union and impose strict limits on the number of foreigners allowed in.
President Didier Burkhalter, who is also his country's foreign minister, said he planned to tour European capitals to explain Sunday's referendum and seek a solution.
"The people are sovereign, and a healthy system doesn't force the public to follow political authorities," said Mr Burkhalter who campaigned against the referendum.
But the EU, which already faces a continent-wide backlash against immigrants and demands to tighten border controls, is unlikely to exempt Switzerland.
"The single market is not a Swiss cheese. You cannot have a single market with holes in it," European Commission vice-president Viviane Reding told the Financial Times in an early warning of the troubles ahead.
The Swiss repeatedly turned down offers to join the EU but cannot escape geography: they are surrounded by EU member- states on whose trade they depend.
The solution was a series of accords reached in 1999 which allowed Switzerland and the EU to enjoy access to each other's markets without Switzerland having to opt for full EU membership, provided the country opened its borders to EU citizens.
But the deal was always a potential target of Switzerland's other notable peculiarity: a unique constitutional system which allows people to initiate a referendum on any topic, provided they can muster 135,000 signatures.
Crucially, the latest referendum was backed by the populist People's Party, which now has the largest number of seats in parliament.
That meant voters were mobilised and the turnout passed the strict thresholds demanded by the Constitution for a referendum to be valid.
The Swiss government also had a credibility problem: it initially predicted that only 8,000 foreigners would come each year. The ultimate number was 80,000, not a large number in absolute terms, but a concern in a country where already a quarter of all inhabitants are first-generation foreigners.
In vain did the defenders of open borders point out that Switzerland's pharmaceutical and precision-engineering companies need foreign talent, and that some of its biggest brands, including food giant Nestle and watchmakers Patek Philippe and Swatch, were founded by immigrants.
The proponents of foreign labour controls were able to point to overpopulation which has driven up rents and boosted housing construction - marring Switzerland's pristine scenery - and caused growing health-care burdens, and overcrowding on the country's famously efficient transport system.
The prominence of well-paid bankers among those opposing labour restrictions was counter-productive: it invited a revolt against a well-heeled elite which "allowed a state of affairs where people felt the losers", as Mr Christian Levrat, a prominent Socialist lawmaker, admitted.
The result creates a dangerous split in the multi-lingual country. The French-speaking cantons - as Switzerland's autonomous regions are known - voted for open borders, while the German-speaking ones and Ticino, the biggest Italian-speaking canton, opted solidly for immigration controls.
Though only 19,516 individual votes - 0.3 per cent of the total - separate the "yes" camp from the "no" camp, the result is binding.
The outcome is a huge boon for anti-immigrant parties elsewhere in Europe: Ms Marine Le Pen, who heads France's National Front was quick to congratulate Switzerland on its "courageous" decision, as did Mr Nigel Farage, leader of the UK Independence Party, who hailed the fact that the Swiss "now have the freedom to decide the number and skill level of who they wish to invite to work or stay in their country".
Precisely in order not to encourage a backlash against the freedom of labour movement which it considers crucial, the EU will be reluctant to amend its treaties with Switzerland: Finance Minister Wolfgang Schaeuble of Germany, Switzerland's top trade partner, spoke for many when he warned that the referendum "is going to create plenty of problems for Switzerland".
Yet the EU is aware that bullying the Swiss looks bad and may prompt an even bigger anti-immigrant backlash.
It is in everyone's interest to postpone any substantive diplomatic negotiations until the European parliamentary elections are out of the way in May.
But, soon thereafter, the unequal battle between Switzerland and the EU will begin in earnest.
Switzerland's migration conundrum
The Swiss government predicted that 8,000 foreigners would arrive each year, after the rules were changed. But the number of migrants has been 10 times higher, in a country of eight million.
In recent years, the proportion of foreigners has risen from around one-fifth of the population to roughly a quarter.
There are now a million EU citizens in Switzerland, while some 430,000 Swiss live in EU member states.
The majority of recent migrants are from Germany, Italy, France and Portugal.