A majority in Brazil's Supreme Court has voted in favour of making homophobia and transphobia crimes.
The decision will give the community, which suffers constant attacks, real protection, activists say.
At least 141 LGBT people have been killed in Brazil this year, according to rights group Grupo Gay da Bahia.
The Catholic Church and the evangelical movement are frequently critical of gay rights and far-right President Jair Bolsonaro, elected last year with strong support of conservative voters, is a self-described homophobe.
"Homophobic crimes are as alarming as physical violence," Supreme Court Vice-President Luiz Fux said on his vote, citing "epidemic levels of homophobic violence".