A majority in Brazil’s supreme court has voted to make homophobia and transphobia crimes like racism, a decision coming amid fears the country’s far-right president will roll back LGBT social gains.

Six of the Supreme Federal Tribunal’s 11 judges have voted in favor of the measure. 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.