The Swiss have rejected by a wafer-thin majority a rightwing proposal to tighten the asylum laws.
Of 2,240,000 votes cast, a tiny majority of some 3,422 came out against the initiative. The result is provisional, and will only be confirmed in six to eight weeks.
In the closest vote on a people's initiative since 1891, the Swiss rejected by 50.1 to 49.9 per cent a proposal which would have effectively closed the door on 95 per cent of asylum seekers.
The result also highlighted a clear split in voting patterns between German- and French-speaking cantons.
While many German-speaking cantons - including the country's financial capital, Zurich - voted in favour of the proposal, all of the French-speaking cantons voted against the initiative.
Voter turnout was just under 47 per cent.
The Swiss justice minister, Ruth Metzler - who led the government's campaign for a no vote - said she was "incredibly relieved" by the result.
"I am very happy that we can continue to pursue a humanitarian asylum policy," Metzler commented.
"As one of the richest nations in the world, it would have reflected very badly on us if we became the first one to deny the right to asylum," she added.
"I always knew [the result] was going to be close," Metzler told Swiss television, "but I hadn't expected such a Hitchcock-like finish."
She added that the closeness of the outcome made it incumbent on the government to take more seriously the concerns about the asylum issue.
But she said issues such as abuse of Switzerland's benefits system were a criminal matter and should not be addressed through the asylum laws.
The government made clear that the result is still provisional and could conceivably be revised once the official tallies are submitted to the federal authorities.
The head of the federal chancellery, Annemarie Huber-Hotz, told swissinfo: "It can take several weeks until the definitive result is known."
Vote tallies are often adjusted by between 2,000 and 10,000, which could change the outcome of this ballot.
The People's Party declared itself satisfied with the result, even though its proposal was turned down.
"We are almost happy with the result," Aliki Panayides of the People's Party told swissinfo.
"It shows that people didn't believe the [government], and they believed us. It was such a close result that we could have won, so we are positive that now the government will finally do something about the abuse of our system."
The party was heartened by the fact that a majority of cantons came out in favour of the initiative, even though it fell short of winning a majority of the popular vote. It is only the third time since 1948 that a popular majority has overturned a cantonal one.
Gregor Rutz, secretary general of the People's Party, called the referendum a "missed chance" and warned the government that nearly 50 per cent of voters had made it clear at the ballot box that they were unhappy with the current asylum rules.
The Social Democrat parliamentarian, Ruth-Gaby Vermot-Mangold, described the result as "neither a victory nor a defeat", but said the debate about refugees was set to continue.
The United Nations refugee agency - which said the proposal would have made Switzerland's laws the most draconian in the industrialised world - cautiously welcomed the result.
"What this vote means," said spokesman Cris Janovski, "is that [Switzerland's] humanitarian tradition has won, albeit very narrowly."
But he told swissinfo that it was clear the close result meant asylum laws would have to change in Switzerland and the wider world.
"The narrow rejection of the initiative means that a lot of people in Switzerland see a problem with the whole issue of abuse of asylum.
"Switzerland... and other western industrialised countries have to work out a system where this abuse will not be allowed, but where at the same time those who do need protection under international law will be given that protection."
Political analyst Hans Hirter agreed, saying the issue was far from being resolved.
"Of course, it's not over," Hirter told swissinfo.
"As long as there is in western Europe this problem of asylum seekers and immigration... groups like the People's Party will continue to push [for tighter laws]," he added.
Between 1994 and June 2001, Switzerland received by far the largest number of asylum applications of any European country.
With an average of 267 per 10,000 inhabitants, Switzerland is far ahead of the Netherlands, with an average of 179, Germany with 96, Britain's 77 and 34 in France.
In other votes which took place on Sunday, the communes of Emmen and Schwyz once again rejected the majority of applications by foreigners for citizenship - only four out of 17 were successful.
In the commune of Emmen, two Italians and a family from Bosnia-Herzegovina won voters' approval. Voters in Schwyz agreed to grant citizenship to one Italian.
Once more it was applicants from Turkey, eastern Europe and the Balkans who were singled out for rejection.
The two communes have earned international notoriety for their tough stance against granting foreigners citizenship - especially those from the Balkans.
Last December, 12 out of 13 candidates from the Balkans were rejected by Emmen voters. The previous year, 48 candidates saw their applications refused.
Only three out of 30 applicants have been successful in Schwyz over the past two years.
swissinfo with agencies
Of 2,240,000 votes cast, the proposal was rejected by a wafer-thin majority of some 3,422.
It was the closest vote on a people's initiative since 1891.
It's the tenth time the Swiss have rejected proposals to tighten the immigration and asylum laws.
A majority of cantons voted in favour, but the initiative failed to win popular support.
The proposal needed to win both the popular vote and the cantons because it would have required a change to the constitution.