Brazil's supreme court has voted by majority to make homophobia and transphobia crimes like racism. The decision comes amid fears the country's far-right president will roll back LGBT social gains.

Six of the Supreme Federal Tribunal's 11 judges voted in favor of the measure on Thursday. The five other judges will vote in a court session on June 5, but the result will not be modified. The measure will take effect after all the justices have voted.

Racism was made a crime in Brazil in 1989 with prison sentences of up to five years. The court's judges ruled that homophobia should be framed within the racism law until the country's congress approves legislation specifically covering LGBT discrimination.

Brazil's Senate is dealing with a bill to criminalize discrimination based on sexual orientation or gender with sentences of up to five years.

"Racism is a crime against flesh and blood, whether it is a member of the LGBT community, a Jew or an Afro-descendant," Justice Luiz Fux said Thursday.

The court's judges said the ruling was to address an omission that had left the LGBT community legally unprotected.

While same-sex marriage is legal in Brazil, it is still a dangerous country for members of the LGBT community and has a large evangelical movement often critical of gay rights. According to the rights group Grupo Gay da Bahia, 420 LGBT people were killed across Brazil in 2018, while at least 141 have been killed so far this year.