Poles were voting on Sunday in a knife-edge presidential election that has highlighted the country's deep political divisions and may shape its future relations with the European Union.
Incumbent Andrzej Duda, an ally of the ruling nationalists Law and Justice (PiS), takes on liberal Warsaw Mayor Rafal Trzaskowski after a campaign that has shown sharply contrasting visions for the future.
Duda's re-election is crucial if PiS is to deepen judicial reforms that the European Union has criticised as increasing political control over the courts.
The president holds the power of veto and Trzaskowski, who has said he is seeking a more open Poland, has promised that if he wins he will block legislation that he believes would undermine democratic norms.
"(This election) is important because it will be crucial for the next 30 years in Poland," said Przemyslaw Bochenski, a 60-year-old doctor, at a polling station in northern Warsaw.
"If we do not take the right direction now I am afraid that Polish democracy and Poland, everything we have built, will collapse."
Given that Poland's president holds few executive powers, it is unlikely Trzaskowski could bring about significant change if he won. But with the presidency as well as the upper house of parliament in opposition hands, PiS's ability to implement its agenda would be hampered.
Polling stations in the election, a run-off after a first round on June 28, close at 1900 GMT, at which point the results of an exit poll will be announced.
Duda has painted himself as a defender of Poland's Catholic values and the generous social benefit programmes that have transformed life for many, especially in the poorer rural regions of the country, the EU's largest post-communist member.
"I believe we can build the Poland we dream of, a fair Poland, a rich Poland, a strong Poland... a Poland that can protect the weak and doesn't have to fear the strong," he told supporters on Friday.
However, while Duda vows to stand with the weak, critics say his campaign has also drawn on homophobia and anti-Semitism.
He has compared what he calls LGBT "ideology" to Soviet-era communist indoctrination, while state TV, the mouthpiece of the government, has used the sensitive issue of Jewish property restitution to attack Trzaskowski.
MORE TOLERANT POLAND
Trzaskowski, mayor of Warsaw since 2018, became a target for religious conservatives for promoting gay rights after he took part in pride marches and pledged to introduce sex education classes in the city's schools in line with WHO standards.
Jaroslaw Kaczynski, the leader of PiS and Poland's de-facto ruler, told Catholic television station TV Trwam on Thursday that Trzaskowski was at the centre of attempts to allow minorities to "terrorise" the rest of society.
Trzaskowski says he seeks a more tolerant Poland and has criticised PiS's rhetoric, while vowing to abolish state news channel TVP Info.
"Have you ever heard such homophobia, such anti-Semitism, such attacks on everybody who is brave enough to say 'we have had enough'," he asked supporters on Friday, contrasting PiS's use of language with that of opposition politicians.
But while vowing to block PiS's judicial reforms and condemning attacks on minorities, Trzaskowski has stressed that he would leave PiS's popular social benefit programmes intact and not seek to raise the retirement age.
Trzaskowski has tried to portray himself as someone who can unite a divided nation, but many observers say a period of bitter conflict between the PiS-dominated parliament and the presidential palace awaits if he wins.