Despite a little sub-tropical rain, the world's largest gay pride parade, in São Paulo, went off spectacularly. It received broad public support, and no less a figure than Stephen Fry joined a colourful group of revellers who have much to celebrate. The supreme court had just officially recognised the rights of same-sex unions to the privileges held by heterosexual couples, and another judge soon after signed off on the country's first full-fledged gay marriage.

One aspect of the celebrations, however, ignited controversy. The city's main avenue was decorated with posters, designed by an HIV prevention group, that featured 12 barely clothed male models, styled as Catholic saints, but with come-hither looks and the caption: "Not even a saint can save you. Use a condom." The group says the aim was education, but it was hard not to see the campaign as an intentionally provocative shot at the religious right in the increasingly tense confrontation between the two groups.

The church itself, of course, publicly registered offence at the images, but the real new conservative player on the scene is the evangelical Christian movement, a rising political force that is mounting an increasingly threatening assault on the gay rights movement and moving sexual issues closer to the centre of Brazilian politics. That group had conspicuously organised a massive "March for Jesus" just days before the gay pride march, and didn't waste much time getting around to railing against gay marriage. In this traditionally Catholic country, more and more are becoming evangelical Christians – now likely more than 20% of the population – and are more eager to make their version of Christianity a political issue.

Despite the persistence of persecution, official mainstream Brazilian society is relatively accepting of gay culture. Former president Luiz Inácio Lula da Silva had as a personal spiritual adviser the gay-friendly liberation theologist Frei Betto, and the de facto rights of same-sex civil unions have been recognised in Brazil since 2004. The church opposes gay marriage but makes less of a fuss about the legality of civil unions, and the government of new president Dilma Rousseff has made an end to discrimination a priority.

But when Dilma faced her first political crisis earlier this year, as a corruption scandal brought down her chief of staff, Antonio Palocci, she was outmanoeuvred by a political force that would be familiar in the US but is new here in Brazil: the "evangelical bloc" in Congress. It used her moment of weakness to kill an anti-homophobia bill she favoured that had long been in the works. It's now dead in the water until they can come up with one the evangelical bloc likes. "It's certainly possible to read those posters in the parade as an aggressive reaction to the evangelical movement or at least to their idea of Christianity," says Guilherme Altmayer, an artist active in the gay rights movement. "But there is a clear war now, which has been escalating, and the latest homophobic movements in Congress have been far too radical."

It's not entirely clear that provoking the religious community by creating signs that effectively invite the viewer to have gay sex – albeit protected – with a saint is the most effective strategy for advancing the cause of the gay community. They may be just as likely to offend middle-of-the-road Brazilians, nominally Catholic but usually not church-going and usually fairly liberal on the issue of others' sexuality.

But in the largest of the former Iberian colonies, which way society moves is not being decided on the steps of Mother Church. It is being played out on the streets, in Congress, and increasingly in evangelical congregations more reminiscent of the American south.