Poland's conservative president, Andrezj Duda, has won a second 5-year term.

While all votes have yet to be counted, Duda had more than 51.2 percent of the vote, the AP reported. Duda faced Rafal Trzaskowski, the liberal mayor of Warsaw, in a runoff election held Sunday.

Last month, Duda pledged to defend children from “LGBT ideology” if elected to a second term in office.

In a “family charter” released to shore up his conservative base, Duda reiterated his opposition to same-sex marriage and adoption by gay and lesbian couples. He also vowed to “ban the propagation of LGBT ideology” in schools and other public institutions. And he described the movement to secure LGBT rights as “a foreign ideology” and compared it to Communist propaganda in the Soviet Union.

Duda, a Catholic, is also aligned with the ruling Law and Justice (PiS) party, which is vocally opposed to LGBT rights.

(Related: Gay couple hands out rainbow masks on the streets of Poland.)

The Human Rights Campaign (HRC), the nation's largest LGBT rights advocate, said that Duda's narrow victory shows that “a great number of Polish people” do not support his anti-LGBT views.

“President Andrezj Duda’s reelection after running on a virulently anti-LGBTQ election platform is confirmation that the fight for LGBTQ rights and freedoms is far from over,” said HRC President Alphonso David. “However, Duda’s narrow victory demonstrates that there are a great number of Polish people who do not support his views, including his cruel campaign pledge to ban same-sex couples from adopting children that need loving homes, and his extreme anti-LGBTQ rhetoric. Despite Duda’s victory, LGBTQ advocates will continue to fight in Poland and elsewhere for the basic respect and dignity that our community deserves.”

(Related: LGBT groups condemn Polish president's White House visit.)