Audio By Carbonatix
With all votes counted, Right-wing historian Karol Nawrocki has been elected Poland's new president, the state electoral commission (PKW) said.
PKW said Nawrocki won 50.9% of the votes – ahead of Warsaw's liberal mayor Rafal Trzaskowski on 49.1%.
It's a sensational turnaround from the result of the first exit poll – published immediately after voting ended at 21:00 local time (19:00 GMT) on Sunday – that showed Trzaskowski winning on 50.3% to Nawrocki's 49.7%.
Trzaskowski had claimed victory after the first exit poll, while Nawrocki cautioned that the results were too close to call.
"We won, although the phrase 'razor's edge' will forever enter the Polish language and politics," Trzaskowski told his supporters.
His wife, Malgorzata, jokingly told the crowd, "I'm close to having a heart attack".
Nawrocki had said after the result of the first exit poll, "Let's not lose hope for this night. We will win during the night, the difference is minimal. I believe that we will wake up tomorrow with President Karol Nawrocki."

As Poland's new president, Nawrocki is likely to continue to use his presidential power of veto to block Polish Prime Minister Donald Tusk's pro-EU programme.
The result is also likely also re-energise Nawrocki's supporters, the national conservative Law and Justice (PiS) opposition, which lost power eighteen months ago, giving them renewed belief they will be able to defeat Tusk's coalition in the 2027 parliamentary elections.
Nawrocki supports traditional Catholic and family values and is a strong supporter of Polish sovereignty within the EU.
He backs continued support for Ukraine, but has said he does not want to see the country joining NATO and the EU during Russia's ongoing aggression.
Poland's president has a largely ceremonial role with limited influence on foreign policy and defence, but the president can veto legislation. Tusk's pro-EU coalition government lacks a large enough parliamentary majority to overturn it.
The current conservative incumbent president, Andrzej Duda, has used his powers to prevent Prime Minister Tusk from delivering key campaign promises, including removing political influence from the judiciary and liberalising the country's strict abortion law.
Both presidential candidates support continued assistance for neighbouring Ukraine, but they differ over their approach to the EU. Trzaskowski, a former European minister, supports Tusk's vision of a Poland at the heart of the European mainstream, influencing decisions through strong relations with Germany and France.
Nawrocki, 42, supports a strong sovereign Poland and does not want the country to cede any more powers to Brussels. He opposes the EU's climate and migration policies.

He was relatively unknown nationally before he was selected by opposition party PiS to be their "unofficial" candidate.
A keen amateur boxer and footballer, he often posts images of himself working out. PiS presented him as a strong candidate who would stand up for ordinary Poles and the country's national interests.
A fan of President Donald Trump, he flew to Washington during the Polish election campaign for an extremely brief meeting – and to get a thumbs-up photo of himself with Trump in the Oval Office.
Latest Stories
-
Mr. Aloysius Kwesi Acquah Snr aka Kwesi Anfo
12 minutes -
NACOC’s cocaine suspects arrest commendable, but it cannot run on ‘charity’ to fight drug cartels
21 minutes -
Gov’t cannot deny what it has already set in motion – Former NaCCA boss challenges Mahama on Arabic, Chinese policy
33 minutes -
Telecel Foundation marks Fetu Afahye with HealthFest
49 minutes -
IEAG calls for urgent intervention to decongest ports
58 minutes -
Strong financial, technical capacity non-negotiable for Accra-Kumasi Expressway – Agbodza
1 hour -
Ghana risks losing import trade to Abidjan – IEAGÂ
1 hour -
‎Driver fined GH¢900 for dumping concrete on Madina-Adenta HighwayÂ
1 hour -
Police interdict officer over death of 23-year-old law student
2 hours -
Accra-Kumasi Expressway: Only nation-wreckers will oppose project – Frank Amoakohene
2 hours -
Emerging agri-journalists gather in Croatia for global event
3 hours -
PPI Ghana congratulates Dr Abdul-Baasit Aziz-Bamba: Ghana needs a proper reset on value for money
3 hours -
Kasise Ricky Peprah writes: GBA’s face must be called out – for the record
3 hours -
Bernice Offei battled dementia for five years before death, former manager reveals
3 hours -
Jordan Ayew’s return offers Ghana timely boost ahead of AFCON qualifiers
3 hours