WARSAW—Poland's presidential challenger headed for an election victory on Sunday night, according to a late poll, which showed him unseating the incumbent president after a contentious battle in the politically divided nation.

Conservative opposition candidate Andrzej Duda won 52% of the vote, according to a poll by Ipsos pollster for television stations TVP, TVN and Polsat. President Bronislaw Komorowski, who had initially hoped for a comfortable re-election, won 48% in the final runoff, the poll showed.

If confirmed by Poland's electoral authority, Mr. Duda's victory will be the first for his conservative Law and Justice party since 2005 when it won the country's presidential and parliamentary elections.

Mr. Komorowski immediately conceded his defeat.

"It didn't work this time," he told a rally. "Citizens of free and democratic Poland have decided. Democracy means that election results must be recognized and respected. I congratulate my rival on his election and wish him success as president."

The incumbent president appeared to have lost his re-election bid despite fervent support by the ruling center-right camp led by the Civic Platform, of which he used to be a prominent member. Mr. Komorowski's campaign focused heavily on celebrating Poland's relative economic and political success since the collapse of communism in Europe in 1989, a mood not shared by millions of voters with wages much below European standards.

"President Komorowski has paid a price not only for himself but also for his party colleagues," said Leszek Miller, a former prime minister in the 2000s who leads the postcommunist Democratic Left Alliance party.

The Civic Platform has defended its track record by citing uninterrupted growth in Poland even during the global financial crisis. Poland was the only country in the European Union that didn't slip into recession in 2009. Gross domestic product has risen by about a quarter since 2007 while the rest of Europe was stagnant.

Still, the average net wage in Poland was $800 in March and the country's per capita economic output is around two thirds of the EU average. More than two million people have immigrated out of Poland since it joined the EU in 2004 when employment restrictions were lifted.

The conservative challenger has pledged to draft laws to give bigger tax breaks to the least affluent and to reverse a recent increase in retirement age, moves the incumbent president has eventually tried to mimic despite first calling them populist.

Mr. Duda's presidency will likely introduce even more skepticism about the adoption of the euro in Poland, the largest EU state obliged by treaty to abandon its national currency and yet still outside the currency area. During the election campaign, Mr. Duda said Poland should wait with deciding whether to replace its zloty currency with the euro once economic output is more on par with that of the eurozone's core countries. The current Polish government has no plan to introduce the euro anytime soon for fear of a decrease in purchasing power.

Mr. Duda promised a bolder foreign policy stance, particularly regarding a resurgent Russia next door. He said Poland under his presidency would work even more aggressively to get the West to stand up to the Kremlin and urged more military equipment from the North Atlantic Treaty Organization, including permanent bases, on Polish soil as a deterrent. He said the equipment and bases should be moved to Poland, NATO's eastern flank since 1999, from the west of Germany.

Mr. Duda will also likely stiffen Poland's opposition to more ambitious carbon dioxide emission targets by the EU, a policy pursued for years across party lines by the coal-rich country.

The new president will next year appoint a new governor of the National Bank of Poland, which earlier this year cut its main interest rate to 1.5%, the lowest level on record. Mr. Duda hasn't made his preference known for the successor of Marek Belka, a former Social Democratic prime minister of Poland, the central bank chief since 2010.

Write to Martin Sobczyk at martin.sobczyk@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires