Brazil has never been hotter. Tourists and entrepreneurs are flocking to the country for its natural beauty and its booming business climate. Portuguese professionals are seeking work in the former colony. And the country's legendary party scene is at a fever pitch. But behind the "Carnaval" mask, an ugly trend is emerging.

Though the overall crime rate is down sharply in major cities, murders of gays and lesbians are on the rise. It’s especially acute in the most populous areas: Bahia, Minas Gerais, and the cities of Rio de Janeiro and São Paulo—precisely where police have made their biggest dents in criminal activity in general.

Attacks against gays have climbed steadily for most of the last decade, with 272 murdered in 2011—one every 36 hours, according to Grupo Gay da Bahía, a leading gay-rights group that tracks antigay violence. This year, GGB reports, it’s even worse, with 75 murders in just the first 10 weeks. That’s one every 24 hours.

The antigay surge may come as a double surprise. After all, Brazil is not just famous for its bonhomie, it's also home to one of the best-organized gay-rights movements anywhere, whose activists pride themselves in rolling out the biggest gay-pride parade in the world. But success has its price. As homosexuals have won a place for themselves, they also have become visible targets. Behind the samba beat, the country remains deeply polarized at home, in politics, and in the pews.

“The extent to which the rights movement is able to reach people is a tremendous victory, but this creates anxiety amongst many,” said James Green, a professor at Brown University and an authority on homosexuality in Brazil. The “anxiety” finds its expression in violence, he said.

Policymakers have taken note. For the past five years a group of lawmakers has been at work on legislation to stop the bloodshed. Their goal is to turn homophobia into a crime. The so called Anti-Homophobia law calls for up to three years in prison for anyone found guilty of discriminating or inciting violence against homosexuals. One of the leaders of the drive is Sen. Marta Suplicy of the left-wing Workers Party (PT). A trained sexologist and a former mayor of São Paulo, Suplicy is no newcomer to the rugged world of Brazilian politics.

Nonetheless, when the bill raised howls from Brazil’s powerful religious lobby, she was forced to dial back, removing an article that criminalized public utterances against gays. Legislators connected to the growing flock of Protestant evangelical churches protested that the new law would criminalize faith-based sermons that drew on Scripture to criticize homosexuality. The bill was reworded.

After the evangelicals also rejected an even more watered-down version in December, the bill was sent back to committee, which, in Brazilian political terms, puts it on the legislative endangered list. Fighting back, Suplicy recently announced on Twitter that the Human Rights Commission had approved her request for a public hearing on the bill, scheduled for May. But activists aren't holding their breath. “The evangelical bloc will never pass one law which would be to our benefit,” says Toni Reis, president of the Brazilian Association of Lesbians, Gays, Bisexuals, Transvestites and Transexuals (ABGLT), who recently criticized the redrafted law for creating a human-rights hierarchy.

Brazil’s evangelicals are not the only obstacle. Although many fellow PT members say they favor the criminalization of homophobia, President Dilma Rousseff seems reluctant to take a definite stance. Recently, she has kept conspicuously quiet on the issue, and last year even vetoed the “Kit Gay,” a widely hailed educational packet designed to teach schoolchildren sensitivity around homosexuality and homophobia.

Blocked in the national legislature, gay-rights advocates have turned to local initiatives. São Paulo state representative Telma de Souza of the Worker’s Party has proposed a Delegacia Gay, a special unit in the São Paulo police force, tasked specifically with handling antigay crime. The unit would be modeled on the Delegacia da Mulher, a unit charged with curbing and dealing with violence against women. In addition to trying to diminish violence against gays, officers of the Delegacia Gay would receive special training, both in psychological counseling and in human rights, to better deal with victims of hate crime. “There is not enough being done in the political spectrum to combat the prejudice and violence against homosexuals,” says Souza, who is calling for a broad public debate on the problem.

The initiative couldn’t be timelier. A little more than a year ago, a young man (who as it happened was straight) was strolling down the Avenida Paulista in the heart of São Paulo’s financial district with two homosexual friends when he was assaulted by a group of teenagers. They crushed a fluorescent lightbulb over his face. The unprovoked violence of the attack jolted the nation, not least because it took place in plain view, in the heart of the nation’s most sophisticated metropolis. Specifically referring to this incident, Souza says, “This should not be occurring in the 21st century. We are not talking about gay rights here, but human rights.”