Seeking close ties with US President Donald Trump, Duda has vowed to tighten already highly restrictive laws against abortion and has campaigned against LGBT rights.
The incumbent won a new five-year term with 51 per cent in Sunday's vote against Warsaw's liberal mayor Rafal Trzaskowski, who had promised to mend ties with the European Union.
Experts said the result means the governing PiS party, which has been criticised at home and abroad for controversial reforms of the judiciary seen as eroding democratic freedoms, will face a more confident opposition.
"It’s a small victory,” said Kazimierz Kik, a political expert from Kielce University.
"President Duda has won the election but the real success is for Rafal Trzaskowski and the opposition which has gained ground,” he said.
Anna Materska-Sosnowska, a Warsaw University political scientist, said the high mobilisation of young people for Trzaskowski pointed to "a new opposition force”.
But she warned there was also a "realistic” risk that Poland could begin to resemble Hungary, which has been accused of drifting towards authoritarianism under nationalist Prime Minister Viktor Orban.
‘Poland divided in two’
The government faces the immediate challenge of dealing with the fallout of the coronavirus pandemic, which is pushing Poland into a recession — the country’s first since the fall of communism three decades ago.
"Poland is split down the middle,” said Witold Orlowski, a professor at Warsaw University of Technology Business School, predicting "a very difficult period” ahead.
"On the one hand, even this slim victory is a PiS success and will allow it to continue to govern, at least technically,” Orlowski said.
"On the other hand the social and economic situation will deteriorate and a large part of the electorate will blame the PiS.”
On the foreign policy front, experts said Duda’s close ties with Trump could also spell trouble ahead if the US president fails to win reelection in November.
Duda’s support was particularly strong among older voters in rural areas and small towns and in the east of the country, while Trzaskowski has performed well with a younger electorate in larger cities and western regions on the border with Germany.
"The result of these elections is a Poland divided in two with a not-so-rosy future, as it will be difficult to ease the division and to restore the relationship between the two sides,” analyst Kazimierz Kik told AFP.
White-red vs rainbow
The election had been due to be held in May but was delayed because of the pandemic.
Duda won the first round of voting on June 28 with 43.5 per cent against 10 challengers, including Trzaskowski, who came second with 30.4 per cent.
Ahead of Sunday’s run-off vote, Trzaskowski campaigned hard to sway voters who backed other opposition candidates.
Four days before the first round, Duda became the first foreign leader to visit the White House since the start of the pandemic and received praise from Trump for doing an "excellent job”.
Justice Minister Zbigniew Ziobro characterised the second round vote as "a clash of two visions of Poland, the white-red and rainbow-coloured”, referring to the colours of Poland’s national flag and the symbol widely used by the LGBT community.
Duda has railed against "LGBT ideology”, likening it ot a new form of communist brainwashing, and has vowed to change the constitution during his second term to rule out adoptions by same-sex couples.