Andrzej Duda / REUTERS

Poland's President Andrzej Duda got the most votes in the first round of elections, final results showed on Tuesday, as the focus turned to what looks set to be a close-fought run-off vote on July 12.

Duda, an ally of the ruling nationalist Law and Justice (PiS) party, will now face off against liberal Warsaw mayor Rafal Trzaskowski, a member of the centrist opposition Civic Platform, Reuters said.

Read alsoRussia's pseudo-vote on resetting Putin's terms in power "looks like a gameshow" – media

The president's role is largely ceremonial, but he has the power to veto legislation put forward by parliament.

Trzaskowski would be able to block legislation from the PiS-run lower house of parliament if he can persuade supporters of other candidates to back him and hand him the top job.

Duda got 43.50% of the vote in the first-round presidential vote and Trzaskowski came second with 30.46%, the results showed.

"The voter who voted for (far-right Confederation candidate) Krzysztof Bosak or (independent candidate) Szymon Holownia can pick cooperation with the government or fighting between the president and the government for three and a half years,' government spokesman Piotr Muller told private broadcaster Polsat on Tuesday.