Historian Karol Nawrocki was elected Poland's new president, the state electoral commission (PKW) announced on Monday.
PKW said Nawrocki won 50.9% percent of the votes, ahead of Warsaw's liberal mayor Rafal Trzaskowski on 49.1%.
The final results declared Nawrocki the victor, whose first exit poll results were only 49.7%.
Trzaskowski had claimed victory after the first exit poll.
"We won, although the phrase 'razor's edge' will forever enter the Polish language and politics," Trzaskowski said after the first exit poll.
On the other hand, Nawrocki waited for the final results, calling to his supporters, "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."