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 has shown.

Mr Duda, a right-wing populist and close ally of US President Donald Trump, was on 50.4% in the survey by Ipsos published just after polls closed this evening.

His 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%.

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.

Mr Wojciech, a 59-year-old builder who declined to give his surname, said he chose Duda because his close ties to Trump meant Poland "can count on the US for defence".

He also said he "agrees completely" with the president'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 Trzaskowski hoping for "less hate, less division" among Poles.

Duda's support is strong in rural areas and small towns and the east of the country, while Trzaskowski performed well in larger cities and western regions on the border with Germany.

Rafal Trzaskowski with his wife Malgorzata casts his ballot at a polling station

Experts are warning that today's result could be so close that legal challenges and protests may ensue.

In the first round on 28 June, Mr Duda came first with 43.5% and Mr Trzaskowski second with 30.4%.

But Mr Trzaskowski will be hoping to sweep up votes from Poles who supported other opposition candidates.