Swiss voters overwhelmingly rejected on Sunday a right-wing party's attempt to scrap a pact allowing the free movement of people from the European Union, opting for stability amid the economic uncertainty caused by the coronavirus pandemic.
The Swiss People's Party (SVP) had forced a referendum on the EU agreement in a bid to curb immigration to the country where foreigners make up a quarter of the population.
The measure lost, as expected, by a 62%-38% margin.
"The bilateral path is the right one for Switzerland and for the EU. The Swiss people have confirmed this path again today," Justice Minister Karin Keller-Sutter told reporters in Bern.
"Today is a great day for the relations between the European Union and Switzerland," European Council President Charles Michel tweeted. "The Swiss people have spoken & sent a clear message: together we have a great future ahead of us."
The SVP - the biggest party in parliament - has long pushed to take back control of immigration, echoing some arguments pro-Brexit politicians used in the run-up to Britain's exit from the EU. It won a referendum on the issue in 2014, only to see parliament water down its implementation.
Opponents said the plan would have robbed business of skilled workers and torpedoed accords that enhance non-EU member Switzerland's access to the crucial EU single market.
Around two-thirds of the 2.1 million foreigners living in Switzerland in 2019 were citizens of the EU, as well as Iceland, Norway and Liechtenstein, which with Switzerland are members of the European Free Trade Association (EFTA).
More than 450,000 Swiss live in the EU.
The domestic political battle immediately turned to Switzerland's biggest foreign policy headache: a stalled treaty meant to cement ties with the EU but which critics say infringes too much on Swiss sovereignty and would never win a referendum.
With questions open over state aid, rules to protect high Swiss wages, and access to welfare benefits, the Swiss have dragged their feet while trying to forge a domestic consensus, triggering a row over cross-border stock trading.
"The government will determine Switzerland's position in the coming weeks and take up discussions with the EU over the issues that remain open," Keller-Sutter said.
Voters also blocked an attempt to make it easier to shoot wolves deemed a threat to livestock.
They narrowly approved the government's plans to buy new fighter jets for up to 6 billion Swiss francs ($6.46 billion).