Poland's nationalist incumbent Andrzej Duda has won the first round of a presidential election but will have to face the centrist mayor of Warsaw in a run-off on July 12.
The race could transform the nation's ties with the EU.
The re-election of government ally Duda is crucial if the ruling nationalist Law and Justice (PiS) party is to implement further its socially conservative agenda, including judiciary reforms the EU says contravene democratic standards.
An exit poll showed Duda winning 41.8 per cent of ballots on Sunday, against 30.4 per cent for Rafal Trzaskowski from the Civic Platform party.
Final results could differ slightly but any changes are not expected to affect who will compete in the second round.
Opinion polls conducted before the vote predicted Duda and Trzaskowski running neck-and-neck in the run-off if they scored the top two spots on Sunday.
PiS has cast Duda as the guardian of its generous welfare programs, which have helped it win national elections in 2015 and 2019, and of its pledge to protect traditional family values in predominantly Catholic Poland.
A devout believer himself, Duda had campaigned on a promise to ban classes about gay rights in schools, saying LGBT "ideology" was worse than communist doctrine.
"The campaign goes on because Poland needs it," Duda told jubilant supporters in the central town of Lowicz.
"Some people have a complex and think we are not Europeans. We are, and have been for 1500 years, since we converted to Christianity."
But his long-held lead crumbled in the weeks ahead of the election after a late entry by Trzaskowski, who appears to have galvanised many voters keen to end Poland's isolation within the EU or angry over Duda's allegiance to PiS.
Australian Associated Press