With all ballots counted, Nawrocki received 50.89 percent of the vote, while his centrist rival, Warsaw Mayor Rafał Trzaskowski, garnered 49.11 percent, the National Electoral Commission (PKW) said on its website.
It added that Nawrocki won a total of 10,606,628 votes, compared with 10,237,177 for Trzaskowski.
Voter turnout in Sunday’s runoff was 71.63 percent, up from 67.31 percent in the first round of voting two weeks earlier, according to the election authority.
The Polish president holds veto power over legislation passed by parliament, a key prerogative in a deeply polarised political landscape.
Outgoing President Andrzej Duda, whose second term ends on August 6, congratulated Nawrocki on his victory and thanked voters for turning out in large numbers, "for fulfilling their duty as citizens" and "for taking responsibility for Poland."
US President Donald Trump's nominee for ambassador to Warsaw, Thomas Rose, said on X: "Congratulations to Poland - proving yet again throughout the ups and downs of a hard fought campaign between two great patriots exactly what a strong, proud and free people and nation they are! If Poland wins the world wins!"
An initial exit poll released after voting ended on Sunday evening had pointed to a Trzaskowski victory.
Speaking to supporters on election night, Trzaskowski claimed victory but cautioned that his lead was razor-thin.
Rafał Trzaskowski with wife Małgorzata. Photo: PAP/Paweł Supernak
He thanked voters and all those who backed him in the race, pledging to "connect and build" if confirmed as the country's new president.
"This is a special moment in Poland’s history, and I am convinced it will help us all move forward ... to focus primarily on the future," he told the crowd.
"I will truly be the president of all Poles; I will be your president," he declared.
'We will win and save Poland'
Nawrocki, meanwhile, urged his supporters to wait for the official results.
Karol Nawrocki votes at a polling station in Warsaw on Sunday, accompanied by his family. Photo: PAP/Paweł Supernak
“We will win and save Poland," he vowed.
"We have to win tonight—and we know we will," he added, as updated projections and vote counts were expected later in the night.
Nawrocki's win could usher in a period of heightened political tension and pose new challenges to the pro-European government of Prime Minister Donald Tusk, potentially leading to legislative gridlock, particularly on judicial and social reforms, according to political analysts.
The election outcome marks a significant shift in Poland’s political landscape, signaling a resurgence of right-wing sentiment.
Nawrocki’s campaign emphasised traditional values and a cautious approach to European integration.
Trzaskowski’s narrow defeat underscores the polarisation of Polish society, with urban centres leaning liberal and rural areas favouring conservative policies.
Nawrocki, an Eurosceptic historian backed by the right-wing opposition Law and Justice (PiS) party, pledged to oppose liberal reforms, promote traditional Catholic values, and align Poland more closely with Donald Trump’s America.
Trzaskowski, a senior figure in Tusk’s ruling Civic Coalition (KO), campaigned on a platform of strengthening EU ties and democratic institutions.
The close race highlighted a deep divide among the electorate over the country's future direction.