Campaigning in Poland for the European elections has descended into a war of words over religion, sex and morality after a documentary on clerical abuse raised questions about the government’s ties to the Catholic church and the ruling party campaign sought to portray LGBT rights supporters as a threat to children.

The release on YouTube earlier this month of the documentary, viewed more than 20m times and featuring several victims confronting their sexual abusers, electrified what had already been a febrile debate over the role of the powerful Roman Catholic church in Polish politics and society, during which homosexuality has regularly been equated with paedophilia.

“In the last campaign, the big threat was Muslim migrants. At other times, the enemy is the Jews. Now it’s our turn,” said Piotr Godzisz of Lambda, an NGO that monitors hate crimes against Poland’s LGBT community.

LGBT rights and a perceived threat to traditional values have been front and centre of the campaign since it began in early March, when Rafał Trzaskowski, the recently elected liberal mayor of Warsaw, unveiled a series of commitments to uphold minority rights and support sexual education for young people.

People hold a large rainbow flag during a protest in support of Elzbieta Podlesna who was detained for offending religious beliefs. Photograph: Kacper Pempel/Reuters

In response, Jarosław Kaczyński, the leader of Poland’s ruling rightwing Law and Justice party (PiS), gave a speech to party activists in which he warned advocates of same-sex marriage and adoption to “keep your hands off our children”, and PiS politicians accused the opposition European Coalition of promoting the “sexualisation” of young people.

Kaczyński told a conference organised by Catholic Action, a lay group that promotes Catholic values, that LGBT rights and “gender theory” were an existential threat.

“These ideologies, philosophies, all of this is imported, these are not internal Polish mechanisms,” Poland’s most powerful political figure told the gathering in the central city of Włocławek. “They are a threat to Polish identity, to our nation, to its existence and thus to the Polish state.”

Jaroslaw Kaczyński, the leader of the ruling Law and Justice party. Photograph: Kacper Pempel/Reuters

Tensions were high again earlier this month after Donald Tusk, the outgoing European Council president, attended an event at the University of Warsaw. The former Polish prime minister is widely expected to stand in next year’s presidential election after his term in Brussels is over.

While Tusk, Kaczyński’s political arch-rival, gave an uncontroversial address calling for Polish society to reunite, the speaker before him accused the Catholic church of abandoning Christ’s teachings and forfeiting its moral authority.

Donald Tusk on a pro-European march in Warsaw. Photograph: Kacper Pempel/Reuters

The remarks were seized upon by PiS as proof that Tusk was plotting an attack on traditional values. Kaczyński told supporters at a “patriotic picnic” the next day that “he who raises his hand against the church raises his hand against Poland.”.

Two days later, a prominent feminist activist was detained and her home searched by police over the production and distribution of images of the Virgin Mary with a rainbow-coloured halo.

The government denies that the arrest, described by the Warsaw-based Helsinki Foundation for Human Rights as “deliberately targeted repression”, was the result of political pressure. But tensions rose again when a ruling party MP, Anna Siarkowska, submitted a series of requests to government-controlled prosecutors requesting the prosecution of liberal journalists who circulated the image.

However, PiS’s close identification with the church during the campaign may soon come to look like a serious misstep after the release of Just Don’t Tell Anyone, a documentary made by brothers Tomasz and Marek Sekielski.

Just Don’t Tell Anyone is a documentary about child abuse by Catholic priests in Poland.

The crowdfunded film documents several instances of child sexual abuse by Catholic priests, and the subsequent inaction or cover-ups on behalf of senior clergy. It features victims confronting their aggressors, and describes a number of instances in which priests found to have sexually abused children are sent to places where they are entrusted with the care of minors.

With pressure building on the church hierarchy, some senior clerics have sought to distance themselves from the government. Last week the primate of Poland, Archbishop Wojciech Polak, announced a compensation fund for victims of abuse, saying he “does not see any raised hand” against the church, and criticising clergy who had openly endorsed PiS candidates.

The controversy has encouraged more radical voices to increase the homophobic rhetoric. On Monday, a prominent anti-abortion and far-right candidate for the European parliament, Kaja Godek, claimed gay people wanted to be able to adopt children “because they want to molest and rape them”.

“To fight against paedophilia in the church and everywhere, we must above all limit the influence of the homo lobby,” Gadek told broadcaster Polsat.

A Poland in Europe march in Warsaw. Photograph: Kacper Pempel/Reuters

Whilst dismayed that LGBT rights have again been dragged into the political fray, many Polish activists note that the recent rise in homophobic rhetoric belies more positive social trends. Surveys show a notable rise in tolerance and empathy towards the LGBT community, and the emergence of a confident new generation of activists in smaller towns and cities.

“Ten years ago, it would be unthinkable to arrange a grassroots-led Pride march through the streets of my home town,” said Bartosz Staszewski, who last year helped organise the first Pride event in Lublin, a city in the conservative heartlands of south-east Poland.

But while many underlying trends are improving, the overall picture remains bleak, especially for teenagers. A University of Warsaw study last year found that more than two-thirds of people identifying as LGBTI had endured psychological or physical violence, with 70% of teenagers identifying as LGBTI had had suicidal thoughts.

“We are resilient. As a movement, the hatred makes us stronger,” said Godzisz. “But for the most vulnerable people – it will kill them.”