Andrzej Duda, Poland’s incumbent president, has narrowly won the presidential election as the results from over 99 percent of polling stations released so far show.

The remaining uncounted votes are unlikely to sway the final outcome, the National Electoral Commission said on Monday. The result reflects the deep divisions within the European Union nation.

Duda, who is backed by the ruling right-wing Law and Justice Party (PiS), won 51.21 percent of the vote, while opposition candidate, liberal Warsaw Mayor, Rafal Trzaskowski, got 48.79 percent.

Duda had campaigned on traditional values and social spending in the mostly Catholic country as he fought for a second five-year term. His victory could have profound implications for Poland’s relationship with the EU.

Trzaskowski, a former European Parliament lawmaker who joined the race relatively late, opposes Duda’s denigration of urban liberals, the LGBTQ community and other minorities, and aimed to counter an erosion of democratic rights under the ruling party. He represented the centrist opposition Civic Platform party that was in power in from 2007 to 2015.