|By Agnieszka Barteczko and Pawel Florkiewicz

|By Agnieszka Barteczko and Pawel Florkiewicz

WARSAW (Reuters) - Polish President Andrzej Duda unexpectedly announced on Monday he would veto two of three judicial reform bills passed by parliament that have triggered nationwide protests and raised EU and U.S. concerns about a politicization of the courts.

Duda, an ally of the ruling right-wing, eurosceptic Law and Justice (PiS) party, said while he agreed with the government on the need for an overhaul of the judiciary, the proposed measures were not in line with the constitution.

Prime Minister Beata Szydlo, clearly disappointed, said her government would not "yield to pressure" to drop the reforms but did not say how it would now proceed. PiS lacks a big enough parliamentary majority to overturn Duda's veto.

"I use the right of veto because (the proposals) require changes to ensure they conform with the constitution," Duda said in a televised address to the nation, adding that he would shortly present his own proposals.

His action appeared to catch the government off guard, while drawing only a cautious response from Brussels. PiS leader Jaroslaw Kaczynski, Poland's most powerful politician though without a government post, made no public comment on the veto.

The overhaul of the judiciary, coupled with a drive by PiS to expand its powers in other areas, including control of media, has provoked a crisis in relations with the European Union and sparked one of the biggest political conflicts since Poland overthrew communism in 1989.

Many Poles view the judiciary as corrupt and dominated by communist-era ways of thinking, while others see the government's reform efforts as a power grab that will undermine Polish democracy.

For days, tens of thousands of protesters have held candlelit vigils in cities including Warsaw, Krakow and Poznan, demanding that Duda veto the reforms. Protests continued on Monday outside the PiS headquarters and Duda's office in Warsaw.

"A FAIR POLAND"

In her own televised national address on Monday evening, Szydlo said: "We all want to live in a fair Poland, this is why the reform of the courts is needed... Today's veto by the president has slowed down work on the reform."

The government would not "yield to pressure from the street and from abroad", she added.

Under the vetoed reforms, all current Supreme Court judges would have been immediately removed except those approved by the justice minister, who is also the prosecutor general.

They would also have given parliament the right to name most of the members of the National Council of the Judiciary, which would nominate future candidates for the president to appoint to the Supreme Court.

"Reform in this form will not increase the sense of security and justice ... Change has to be made in a way that doesn't separate society and state," Duda said in announcing his veto.

He later held talks with Szydlo and the speakers of the two houses of parliament.

The opposition and most legal experts say the changes would violate the Polish constitution. The government says the courts currently serve only the "elites" and rejects suggestions that Poland is heading towards authoritarian rule.

The European Commission last Wednesday gave Poland a week to shelve the reforms, which Brussels says would put courts under direct government control.

On Monday it reserved judgment on Duda's move pending a discussion at its next meeting, on Wednesday. But Germany's foreign office minister Michael Roth welcomed the veto and said he hoped Warsaw would completely ditch the reforms.

Polish opposition groups urged Duda also to reject a third bill which gives the justice minister the right to dismiss the heads of lower courts. The president signaled that he would approve this law.

The government would need a three-fifths parliamentary majority with at least half of all legislators present to overturn Duda's veto - something PiS and its coalition partners are unlikely to be able to muster.

The state news agency PAP quoted the speaker of the upper house, the Senate, as saying there might be an additional sitting of parliament next week.

Anna Materska, a political scientist at the University of Warsaw, said Duda's decision to distance himself from a flagship PiS policy after previously appearing closely aligned to the party could mark a political watershed.

"What happened required courage, but the president was backed against the wall and had no other option. This is a key moment in the events of the latest months, maybe even years."

Duda, 45, won the presidency in 2015 with the firm backing of Kaczynski, months before PiS also swept back to power in a parliamentary election on pledges to help poorer Poles and to protect national interests more vigorously in the EU and beyond.

Last week Poland's latest bout of political turbulence helped to push its currency, the zloty, to three-month lows against the euro. Foreign investors welcomed Duda's veto on Monday by pushing the zloty up about 0.5 percent. [EMRG/FRX]