WARSAW, POLAND -- When a right-wing populist party won the right to govern Poland five years ago, Piotr Grabarczyk feared "bad things" might happen to gay men like him and other LGBT people. He sometimes considered leaving the country, but waited.

Friends and a job bound Grabarczyk to Warsaw, the relatively liberal capital city. He trusted that Poland's membership in the European Union would protect his community. Yet his dwindling faith finally fell away as President Andrzej Duda campaigned for reelection on an anti-LGBT platform - and won.

Duda, who repeatedly described the LGBT rights movement as a dangerous "ideology," was sworn into his second term Thursday. Grabarczyk, 31, is now gone, along with other gay, lesbian, bisexual and transgender Poles who have emigrated to escape what they consider homophobia promoted by the highest levels of government.

"Like where's the line? Is there a line they are not going to cross? I don't know," Grabarczyk said after landing last week in Barcelona, Spain, where both same-sex marriages and adoptions are legal. "That was kind of scary."

He spoke to The Associated Press alongside his boyfriend, Kamil Pawlik, 34, who left Poland three days after Duda beat Warsaw's mayor in a runoff last month.

While gays and lesbians have never had the legal right to marry or to form civil unions in Poland, as they can in much of Europe, many felt confident until not long ago that Polish society was becoming more accepting and that those rights would one day come.

They have instead faced a furious backlash from the Catholic Church and the government. Duda proposed a constitutional amendment to prevent same-sex couples from adopting children. Last year, the Roman Catholic archbishop of Krakow warned of a "rainbow plague," and the ruling Law and Justice party has described LGBT rights as a threat to families and Poland's Catholic identity.

While Grabarczyk, an entertainment reporter and blogger with a large YouTube following, and freelance graphic designer Pawlik are not planning marriage or children right now, the proposed adoption ban was their exit sign. They felt that it showed a determination by the authorities to put discrimination into law, as President Vladimir Putin has done in Russia.

No statistics exist on how many LGBT people have left Poland. Activists say some departed after Law and Justice and Duda, who is backed by the party, came to power in 2015 and created an unfriendly climate for liberals and minorities.

As Duda faced a tough electoral challenge from Warsaw Mayor Rafal Trzaskowski, the rhetoric grew harsher. He called the LGBT movement an "ideology" worse than communism and declared that LGBT was "not people." He formally proposed the same-sex adoption ban.

After his victory, Duda apologized for language he acknowledged was sometimes too "harsh." A prominent LGBT activist, Bart Staszewki, nevertheless asked on Facebook if anyone was thinking of moving away from Poland. He received hundreds of replies, mostly from people saying they were contemplating it or had already left.

Britain, Germany, the Netherlands, Spain and other European Union countries are where LGBT emigres are envisioning their futures. They follow generations of Poles who have fled political repression at home, including during the communist era.

The recent exodus represents "a second wave of immigration" after the significant number of Poles who moved abroad to work when Poland joined the EU in 2004, Staszewski said.

"This time, people are not looking for better paid jobs, but they are looking for dignity and respect," he said. "People want to feel that they are protected by the government and not treated as an enemy."

Others are vowing to stay and fight for LGBT rights, among them Staszewski. The 29-year-old said he is inspired by the example of his grandparents, who participated in the underground Polish resistance against the German occupation of Poland during World War II.

But escape is not a realistic option for everyone, particularly those from rural areas without money, foreign languages or other skills required to start over in a new culture.

Michal Niepielski, 57, a radio technician in Krakow who has taken a case to the European Court of Human Rights in hopes of winning the right to marry his partner of 16 years, says he knows some English and could move, but would not be able to work in his field abroad.

Speaking to the AP, Niepielski confessed that he and his partner are "very afraid" but are trying to be positive in their social media comments. The EU's recent decision to deny small amounts of funding to Polish towns declaring themselves to be "LGBT free" gave them enough hope to keep on going, he said.

"We have sympathy with the people who haven't come out of the closet yet and now will have to stay in the closet for a long time, perhaps until the end of their lives," Niepielski said. "That's a tragedy. That's one reason we are staying."

LGBT rights have continued to be a flash point since the election. The Justice Ministry awarded funding to a project designed to counteract crimes "committed under the influence of LGBT ideology."

Three activists protesting homophobia were detained this week and charged with the crimes of insulting monuments or offending religious feeling for hanging rainbow flags on statues in Warsaw, including one of Jesus. If convicted, they could face prison.

There is no law, however, making anti-LGBT hate speech a crime.

Grabarczyk, who recently published an ebook of coming-out stories titled "Mom, I'm Gay. Dad, I'm a Lesbian," said he feels guilty about leaving others behind while he and his boyfriend live in Barcelona. He recalls feeling as a teenager when Poland joined joined the European Union like he was in a new world, where borders didn't exist and he could easily meet people of different cultures, skin colours and sexual orientations.

"For us, it was a given to live in a world like that, and it's all crumbling down now," he said. "So it's only natural to seek a place where we can return to that."