Homosexual couples are to be able to register their partnerships, after voters approved a law giving gays some of the rights enjoyed by married couples.
The new law means gay couples will have the same pension, inheritance and tax rights and obligations. But they will not be allowed to adopt children or have access to fertility treatment.
Homosexual organisations were very satisfied by the result, considering it a symbolic recognition of their status.
"It's a magnificent victory," said Jean-Paul Guisan of Pink Cross. "When I was younger, I would never have imagined this could happen."
"I am very proud of Swiss voters who have shown their openness and their courage."
Exit polls showed that some 58 per cent of voters supported putting gay partnerships on a sound legal footing.
Voter turnout was expected to be high because of another vote on whether Switzerland should join the EU's Schengen/Dublin accords, governing cross-border cooperation on crime and asylum.
Nicole Béguin, co-president of Switzerland's lesbian organisations, said the result was a clear sign that homosexuals were now accepted in the country.
"Ten years ago, such a proposal would never have been approved."
Although the registered partnerships law had been given the go-ahead by parliament, a small conservative religious party, the Federal Democratic Union, collected enough signatures to force Sunday’s referendum.
Opponents said there should be no national legislation on an issue which went against Christian values.
Registered partnerships previously only existed at a regional level in cantons Zurich, Geneva and Neuchâtel.
The approval of the law - the first time it has been voted on at a national level in Europe - brings Switzerland into line with neighbouring Germany and France.
The government-backed measures are aimed at stamping out inequalities in the present system, which can prevent homosexuals from visiting ill partners in hospital or being subject to heavy inheritance taxes.
In the run-up to the vote, the government was at great pains to stress that registered partnerships were not equivalent to traditional marriage.
"A registered partnership is not a marriage; it is an institution for those people who by definition cannot marry," said Justice Minister Christoph Blocher.
Most political parties were in favour of allowing registered partnerships for same-sex couples, but the issue was opposed by Blocher’s rightwing Swiss People’s Party.
The religious community was also divided. The Roman Catholic Bishops’ Conference was against the law, but the Federation of Protestant Churches in Switzerland supported it.
Most of the gay community were also in favour of the move but some were concerned the legislation didn’t allow for families or symbolic gestures, such as saying yes in a ceremony – like in marriage – or using the same name.
Under the law, same-sex couples will be able to register their partnership at a registry office.
They will receive the same pension, inheritance, and tax rights as married couples. Foreign partners will receive residency. But the naturalisation process will not be made easier as with married couples.
Adoption and fertility treatment is forbidden and partnerships can only be dissolved by a court.