Public expressions of hatred for lesbian, gay, and bisexual people will be punished with up to three years in prison.

Above: A billboard urges voters to reject the amendment.

Switzerland has voted to criminalize homophobia.

In a referendum Sunday, 63.1 percent of voters approved an amendment that makes it a crime to denigrate a person’s sexual orientation publicly, The New York Times reports. The amendment is to a law banning discrimination based on race, ethnicity, and religion.

“It includes comments made on television, messages posted on social media, and discrimination against gay or bisexual people in public venues like restaurants or movie theaters,” the Times notes. Violations can be punished with up to three years in prison.

The amendment originally covered anti-transgender statements as well, but Swiss legislators removed that part of the measure because they considered it too vague.

Switzerland’s Parliament had sought to pass the amendment in 2018, but some citizens expressed concern that it would interfere with freedom of expression. Opponents of the amendment gathered 50,000 petition signatures to put it before voters for their approval or rejection. Coca-Cola recently took out ads in major Swiss newspapers urging approval.

Switzerland is behind most Western European countries when it comes to LGBTQ-inclusive anti-discrimination law. “In Switzerland, it’s possible to publicly say, for instance, ‘Burn the gay’ or ‘Lesbians must be raped’ without any concern,” human rights activist Carolyn Dayer told the Times before the vote. This amendment puts a stop to that, she said.

Supporters of the amendment said it will not stifle free expression because it does not cover comments made in private venues — for instance, in a person’s home. And Interior Minister Alain Berset said jokes about gay, lesbian, and bisexual people would not violate the law “as long as they respect human dignity.”

Switzerland still does not allow same-sex marriages, although it makes civil unions available to same-sex couples. A marriage equality bill is currently pending in Parliament.