President Andrzej Duda was ahead by a tiny margin in Poland's presidential election against his europhile rival but the result is too close to call, an exit poll on Sunday showed, keeping the country in suspense into the night.
Mr Duda, a right-wing populist and close ally of US President Donald Trump, was on 50.4 per cent in the poll by Ipsos published just after polls closed at 1900 GMT.
Mr Duda's rival, liberal Warsaw mayor Rafal Trzaskowski, who has promised to heal ties with Brussels by rolling back a controversial reform of the judiciary, was shown just behind on 49.6 per cent.
The result of the vote will be decisive for the governing party, which is accused by critics of eroding hard-won democratic freedoms just three decades after the end of communist rule.

Mayor of Warsaw and candidate for the main opposition party Civic Platform and Civic Coalition's Rafal Trzaskowski. Source: PAP
Mr Wojciech, a 59-year-old builder who declined to give his surname, said he chose Mr Duda because his close ties to Mr Trump meant Poland "can count on the US for defence".
He also said he "agrees completely" with Mr Duda's promise to ban adoption for same-sex couples.
"It's important for there to be calm and good cooperation with our European partners," Warsaw pensioner Danuta Lutecka told AFP after casting her ballot in Warsaw's leafy Mokotow district.
She said she had chosen Mr Trzaskowski hoping for "less hate, less division" among Poles.
Mr Duda's support is strong in rural areas and small towns and the east of the country, while Mr Trzaskowski performed well in larger cities and western regions on the border with Germany.
Distanced queues
Long, snaking queues formed at polling stations as social distancing measures were used to stem infections.
Voters also had to wear masks, use hand sanitiser and their own pens, plus give priority to pensioners, pregnant women and voters with children.
The election had been due to be held in May but was delayed because of the pandemic.

People vote during the presidential election at a polling station in Krasiczyn, Poland. Source: PAP
Mr Duda's support has slipped considerably since then, partly because of the virus fallout, which is pushing Poland into its first recession since communism fell.
The incumbent won round one on 28 June with 43.5 per cent against 10 challengers, including Mr Trzaskowski who came second with 30.4 per cent and has campaigned hard to sway voters who backed other opposition candidates.
'A clash of two visions'
Mr Duda promises to defend highly popular social welfare payments introduced by the Law and Justice (PiS) party government and has led a polarising campaign, attacking LGBT rights and ruling out certain Jewish wartime compensation claims.
Ahead of the vote, PiS Justice Minister Zbigniew Ziobro characterised it as "a clash of two visions of Poland, the white-red and rainbow-coloured," referring to the colours of Poland's national flag and the symbol most widely used by the LGBT community.
The PiS party government has also lashed out at German-owned media outlets, accusing them of "bias" during the campaign after a tabloid owned by the Ringier Axel Springer Group published a story about Mr Duda pardoning a paedophile.
Mr Trzaskowski promises a very different Poland.

President of Poland, Andrzej Duda seen at the polling station. Source: AP
He supports allowing same-sex civil partnerships in Poland and his support for gay rights last year unleashed a protest by mostly southeastern regions which declared themselves "LGBT-free".
"This election will determine Poland's fate for the foreseeable future," said Adam Strzembosz, a former Supreme Court chief justice and respected legal authority.
"Will it be dominated and completely subservient to a certain political party, with all the consequences of power that is dictatorial in nature? Or will we manage to stop this?"