Poland’s ruling party beat back the biggest threat to its nationalist transformation, with incumbent Andrzej Duda poised to emerge the winner of Sunday’s presidential election.

In near-record turnout, Duda won 51.2 percent, an unassailable lead with more than 99 percent of precincts reporting, the state electoral commission said on Monday. The challenger, Warsaw Mayor Rafal Trzaskowski, hasn’t conceded defeat and his aides spoke of voting "irregularities” and protests on Sunday, when exit polls predicted a closer race.

Duda and his allied Law & Justice party have reshaped Poland from a nation hailed as a model of post-communist change to one battling against the European Union’s democratic values.