WARSAW (Reuters) - Poland’s ruling eurosceptic Law and Justice (PiS) scored limited gains in regional government in Sunday’s election, but lost a high-profile race for Warsaw mayor, an exit poll showed, laying bare divisions in Poland over the party’s democracy record.

Polish Prime Minister Mateusz Morawiecki and Jaroslaw Kaczynski, the leader of the ruling Law and Justice (PiS) party, react after the exit poll with results of the Polish regional elections are announced in Warsaw, Poland October 21, 2018. Agencja Gazeta/Slawomir Kaminski via REUTERS

Since sweeping into power in 2015, PiS has remained broadly popular, benefiting from voter-pleasing welfare reforms, nationalist rhetoric and strong economic growth.

But critics at home and abroad have accused it of a tilt toward authoritarian rule after moves to increase government control over the judiciary and public media that have also fueled Poland’s isolation within the European Union.

The party won some 32.3 percent of votes for provincial assemblies, compared with 26.9 percent in a vote four years earlier and 37.6 percent it scored in the 2015 parliamentary election. A coalition of centrist opposition parties was set to win some 24.7 percent, an opinion poll by Ipsos showed.

A strong showing for the agrarian PSL party, which was on track to win 16.6 percent on Sunday, was a blow for PiS which had focused much of its election campaign on winning the rural vote.

In Warsaw, however, the PiS candidate, Patryk Jaki, 33, came in second place after Rafal Trzaskowski, 46, a pro-EU centrist, who unexpectedly secured the office in a first round of voting by winning more than 50 percent of votes.

If confirmed, the results will mean PiS could struggle to keep its support base during a parliamentary election in late 2019 and a presidential vote a year later.

PiS leader Jaroslaw Kaczynski said the party’s showing on Sunday bodes well for next year, but he added: “We have to work, work, and work some more.” PiS leader told party activists after exit polls came out: “The election campaign is starting.”

Final results of the election will be released by the electoral commission by the middle of the week.

The election is part of a larger battle over Europe’s future, as Brexit and Hungary’s Viktor Orban - who like PiS believes the EU’s powers should be reined in - shake up the bloc and right-wing parties make gains across the continent.

With Brussels entering campaign mode ahead of a European Parliament election in May, the Polish vote could give some hints on whether eurosceptic groups can secure a stronger voice and thwart further EU integration.

“I’d say its a tie, with some advantage for the opposition,” said Warsaw University political scientist Rafal Chwedoruk of the Polish vote.

Slideshow ( 20 images )

QUESTIONS OVER LIBERAL DEMOCRACY

While exit poll results can not give a clear indication of how many of Poland’s 16 provincial assemblies will fall under PiS control, any gains will mean better access to local funding. That could affect a general election in 2019. Since the 2014 election, PiS only controls one such assembly.

“I don’t believe in a liberal democracy, because it leads to anarchy,” said Stanisław Lawniczak, 68, a real estate manager who voted for PiS candidates in Warsaw.

The turnout in the election topped 50 percent and was the highest in a regional vote since Poland overthrew communism in 1989, an indication of deep-running divisions that may have galvanized voters.

Winning Warsaw, a bastion of anti-government protests since 2015, was seen as the top prize in the election, with PiS’ Jaki vowing city hall under his leadership would side with ordinary people against what he calls arrogant, liberal elites.

A long-time EU emissary for the centrist Civic Platform party, Trzaskowski had promised the capital would remain “open, tolerant and European”.

“I hope the victory in Warsaw is the first step and that we will win upcoming votes. It’s important for Poland that politicians who respect the rule of law have access to power,” Trzaskowski said after exit polls came out.

Underlining divisions, the EU’s top court ordered the Warsaw government on Friday to suspend an overhaul of the Supreme Court and reinstate judges forced into early retirement.

The moves were part of broader reforms of the judiciary, which PiS says are crucial to making the system more fair and efficient, but opponents say they are an attack on democratic checks and balances.