Sunday's referendum decided on legislation to specifically outlaw hate speech and discrimination on the grounds of sexual orientation with jail terms of up to three years. The criminal code currently covers discrimination based on race, ethnicity and religion.
About 62% of voters favored the legislation, with most parties backing the bill to protect gay, lesbian and bisexual communities. However, the right-wing Swiss People's Party (SVP) — the strongest party in parliament — opposed the law.
The SVP argued that migrants have imported homophobic views and that social dialogue and expulsion of foreign perpetrators would be more effective.
The change was first passed by Swiss parliament in 2018, but it was forced to a referendum after critics said it would stifle free speech.
What do parties say?
The SVP lawmaker Eric Bertinat told the Agence France-Presse that he believes the law is "part of an LGBT plan to slowly move towards same-sex marriage and medically assisted reproduction" for gay couples.
Marc Frueh, head of the Federal Democratic Union of Switzerland (EDU), a small Christian party called it a "censorship law."