Conservative historian Karol Nawrocki, who draws inspiration from Donald Trump, has won Poland’s presidential election.
Mr Nawrocki secured 50.89% of votes while his opponent, Liberal pro-EU candidate Rafal Trzaskowski, took 49.11%.
Earlier, an exit poll called the result the other way around – with both men declaring victory.
Mr Nawrocki had positioned himself as a defender of traditional Polish values, aligning himself with US conservatives, including Mr Trump, and showing scepticism towards the EU.
Meanwhile, Mr Trzaskowski, 53, had promised to ease abortion restrictions, introduce civil partnerships for LGBT couples and promote constructive ties with European partners.
The vote has been closely watched in neighbouring Ukraine as well as in Russia, the European Union and the United States – and the final outcome will decide whether Poland pivots towards more liberal norms or takes a more nationalist path.
Poland’s new president will have significant influence over whether the country’s centrist government can fulfil its agenda, given the presidential power to veto laws.