KIELCE, Poland— Upbeat ’80s pop music accompanied about 1,000 rainbow-draped activists as they embarked on this city’s first LGBT rights march, on July 13. But the music could barely drown out the boos from bystanders.

The marchers proceeded past banners that compared gay people to pedophiles. They pressed on in the face of counterprotesters making threatening gestures and Catholics praying on the sidewalks in silent protest.

The scene reflected a growing tension in this country — between a burgeoning rights movement and a conservative backlash. It’s a tension that the Polish ruling party has been accused of fueling and exploiting.

Ahead of parliamentary elections this fall, Law and Justice has thrown the full weight of its party apparatus behind a campaign that is marginalizing Poland’s LGBT community, its critics say.

The party’s new focus on countering what its officials call Western “LGBT ideology” has largely replaced its prior rallying cries against migrants, said Michal Bilewicz, a researcher at the University of Warsaw who tracks the prevalence of prejudices against minorities in public discourse.

In 2015, anti-migrant rhetoric helped the right-wing populist party come to power, according to data gathered by Bilewicz. But even at the height of Europe’s surge, Poland never saw many non-European migrants, and public attention became more difficult to sustain once the flow to the continent diminished.

This spring, as the Law and Justice party was gearing up for European Parliament elections, its leader Jaroslaw Kaczynski highlighted another supposed foreign danger. Warsaw’s mayor had recently advocated integrating sex education and LGBT issues into school curriculums, in accordance with World Health Organization guidelines. In Kaczynski’s telling, this was “an attack on the family” and “an attack on children.” He called “LGBT ideology” an imported “threat to Polish identity, to our nation, to its existence and thus to the Polish state.”

A Law and Justice campaign ad depicted an umbrella with the party logo protecting a family from rainbow rain.

Regional party officials have since pushed to declare cities and even entire provinces in the country’s conservative southeast ­“LGBT-ideology free.” Activists have counted around 30 such declarations so far, including one in the region where Kielce is located. 

Local Law and Justice councilor Piotr Kisiel, 37, rejected accusations that his party was trying to stir up outrage against gay individuals. He said the party was merely reacting to what it considered to be activists’ efforts to enforce their views on heterosexual people.

Pawel Jabbonski, an adviser to Prime Minister Mateusz Morawiecki, noted that the ­“LGBT-free” declarations had “no actual meaning in terms of regulations.” There is no suggestion that being gay will be outlawed in Poland. And same-sex unions and adoptions by same-sex couples are not legal anyway.

“But the message that it sends is pretty much straightforward,” said Vyacheslav Melnyk, director of the Warsaw-based Campaign Against Homophobia. “There is no place for LGBT people in our community.”

The message has been echoed and amplified by parts of the Catholic Church and by government-friendly media outlets. On Wednesday, a conservative weekly newspaper, Gazeta Polska, announced it would distribute “LGBT-­free zone” stickers with its next issue.

The stickers, featuring vertical stripes in rainbow colors crossed out by a thick black X, prompted a response from the U.S. ambassador to Poland.

“I am disappointed and concerned that some groups use stickers to promote hatred and intolerance,” tweeted Ambassador Georgette Mosbacher. “We respect freedom of speech, but we must stand together on the side of values such as diversity and tolerance.”

The editor, Tomasz Sakiewicz, countered, “Freedom means that I respect your views and you respect mine. We oppose only the imposition of views by force. Being a gay movement activist does not make anyone more tolerant.”

Tensions escalated on Saturday, when a group of men in the eastern Polish city of Bialystok tried to stop an LGBT parade, similar to the one in Kielce the weekend before. Police used tear gas and detained a number of agitators, of whom some had reportedly thrown bottles.

The Law and Justice party’s leadership did not respond to requests for comment for this article. But national party officials have explicitly encouraged the “LGBT-free” declarations. “I think that Poland will be a region free from LGBT,” Elzbieta Kruk, a then-candidate for Law and Justice in the European elections, said in March. In the province of Lublin, government representative Przemyslaw Czarnek reportedly handed medals to local politicians who voted in favor of the declarations.

Also keeping the conflict in the news, Poland’s justice minister last month ordered an investigation of Ikea for firing an employee who expressed homophobic views. And Poland’s Constitutional Tribunal — packed with friendly judges by the Law and Justice party — ruled last month in favor of a printer who refused to produce posters for an LGBT foundation.

Jablonski, the prime minister’s adviser, dismissed the notion that the government was seeking to exploit the topic.

In interviews, more than a dozen human rights watchers, opposition politicians and activists worried about the impact of a new anti-LGBT focus in a country that is more than 80 percent Catholic and where even before, many felt uncomfortable coming out as gay.

With their remarks “on the margins of hate speech,” said Adam Bodnar, Poland’s independent commissioner for human rights, “the government is increasing homophobic sentiments.”

“From the hate speech to hate crimes, it’s a very short way,” said Robert Biedron, the country’s first openly gay mayor.

In conservative Catholic Poland, a gay and atheist politician is seizing the moment

Jablonski, the prime minister’s adviser, said such claims were “exaggerated.”

Poland is ranked among the most restrictive countries in Europe in terms of LGBT rights. Attitudes, though, had been softening. Whereas 41 percent of Poles said in a 2001 survey that being gay should not be tolerated and was not normal, that number had dropped to 24 percent by 2017, according to state pollster CBOS.

“Part of society is really getting more and more liberal and open,” said Polish discrimination researcher and activist Joanna Grzymala-Moszczynska. “But, on [the] other side, we can see the intensification of a homophobic narrative,” she added.

The country has been criticized for not keeping reliable records on homophobic hate crimes, but rights groups across Poland said they had noticed recent increases in homophobic attacks.

Polish mayor and opposition leader dies after a stabbing, prompting fears of further divisions

Kielce Deputy President Danuta Papaj said it was wrong for national or province-level politicians to interfere in what she considered a primarily local matter: ensuring tolerance among fellow residents. 

She warned of the creation of socially excluded communities, or social “ghettos.”

In Kielce, the choice of that term weighs especially heavily. Nearby, the Nazis exterminated Jews and other minorities — including gay people — during World War II. But the killing did not stop with the end of the war. Dozens of Jews were murdered in Kielce in a pogrom on July 4, 1946. The killings convinced many of Poland’s remaining Jews who had survived the Nazi Holocaust that there was no future for them in the country. 

Bogdan Bialek is working to preserve the memory of Kielce’s haunting past. Hours before the city’s first LGBT parade was set to take place, the 64-year-old Catholic was walking through a house that was targeted by the pogrom and today hosts an exhibition.

To him, the 1946 pogrom illustrates how stereotypes and prejudice can bring out evil in people.

The Law and Justice party, Bialek said, won prior elections with the “management of fear” of refugees. But he argued that the way the party was targeting LGBT people was potentially more dangerous.

Now, he said, “it’s not the management of fear but the management of hatred.”

“It’s painful for me, really,” said Ewa Miastkowska, 54, at the recent equality march in Kielce, who added that she cries every other day. The mother of a gay son said she had come from Warsaw to fight for his rights in Kielce. “It’s disgusting,” she said of the ruling party’s anti-gay theme.

Encircled by hundreds of riot police officers, 37-year-old local activist Barbara Biskup said she felt the government was turning LGBT people into scapegoats, just as it had done to migrants.

Her hope, Biskup said, was that city residents would realize that she and other gay neighbors were not enemies of the Polish state. “I hope at least some of them will see we’re just normal people,” she said.

Marcin Terlik contributed to this report.

The new autocrats: How leaders are turning democracy into a tool of oppression

In Eastern Europe, the E.U. faces a rebellion more threatening than Brexit

Europe’s top court orders Poland to halt a law forcing Supreme Court judges into retirement

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news