Switzerland has voted to make homophobic and transphobic crimes punishable with up to a three year prison sentence.

The National Council voted to criminalise homophobic and transphobic acts, putting it on a par with the way the country treats racism.

The council voted 118 for and 60 against to introduce a prison sentence for homophobia and transphobia.

However, the motion still needs to be passed by the Council of States before it can become law.

National councillor Mathias Reynard, who put forward motion, posted on Twitter on September 25: “National Council accepts my parliamentary initiative against homophobia and transphobia!

“A magnificent success for human rights! Final response in December to the Council of States. # LGBT ️ .”

Speaking to Shorlist, Reynard said: “The Swiss Parliament’s decision is great news because it sends the powerful message that homophobia is not an opinion; as for racism, it’s a violation of the law.”

He added: “I tabled the motion after speaking to friends of mine who have personally been victims of verbal and physical homophobic violence.

“And working on this law I found out that the Swiss case-law doesn’t punish either hate speech or incitement to hatred towards LGBT+ people. During the last few years, this loophole in the law has been pointed out several times at an international level.”

The vote has been praised by LGBT+ groups in the country, where equal marriage remains illegal.

Rene Schegg, secretary general of Pink Cross, told Swiss newspaper Le Temps: “The decision of the day is an important step. It will likely bring Switzerland back to the rankings of the International Association of LGBTI People, where our country currently ranks 22nd behind Estonia and Hungary.

“With his stage success, Mathias Reynard said now want to focus on the fight for marriage for all.”

Social media users have also celebrated the vote.

A statement posted on Pride in London’s official Twitter account reads: “Good to see that Switzerland has strengthened the punishment for homophobia and transphobia. People who are found guilty could now get up to three years in prison.”

Another person wrote: “Fantastic news! ️‍ Well done Switzerland .”

And one person said: “Just found out that Switzerland made homophobia and transphobia illegal, im so so happy this shd be the goal for all countries .”