Brazil's supreme court has officially made homophobia and transphobia crimes similar to racism, with the final justices casting their votes in a ruling that comes amid fears the country far-right administration is seeking to roll back LGBT social gains.

Six of the Supreme Federal Tribunal's 11 judges had already voted in favor of the measure in late May, giving the ruling a majority. The final justices voted Thursday for a tally of eight votes for and three against.

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 congress approves legislation specifically dealing with LGBT discrimination.