Swiss voters have rejected a proposal to end an agreement with the European Union on the free movement of people, TV projections suggest.
Broadcaster SRF said voters were set to reject the plan by 63% to 37%.
Ballots are still being counted, and final results are due within hours.
Switzerland is not a member of the EU, but currently accepts free movement so that it can have access to free trade and co-operate with Brussels in areas like transport and education.
Supporters of the anti-free movement plan said it would allow Switzerland to control its borders and select only the immigrants it wants.
Opponents argued it would plunge a healthy economy into recession, and deprive hundreds of thousands of Swiss citizens of their freedom to live and work across Europe.
People have also been voting on a number of other issues.
They appear to have backed paternity leave for new fathers, and rejected a proposal to make it easier to hunt protected species such as wolves.