Poland's president has signed into law one of three contested bills which critics say limit the independence of the judiciary.
Andrzej Duda announced on Monday after days of protests that he would veto two of the bills.
His office said early on Tuesday that he had signed the third one, despite demonstrations the previous evening in several cities urging him to also block that one.
The law allows the justice minister, who is also the prosecutor general, to name the heads of all lower courts.
Critics say it is unconstitutional, but welcomed his rejection of the other bills. One of them would have allowed the justice minister to immediately fire all Supreme Court justices and choose their replacements.
Mr Duda said the law on the Supreme Court gave excessive powers to the prosecutor general.
The European Union had expressed concern over the package of legislation and threatened to act soon to sanction Poland.
Mr Duda's decision appears to mark the first significant rift in the ruling Law and Justice party since he won the presidency on the party's ticket in 2015 and the party won parliamentary elections later that same year.
Until this week Mr Duda had loyally accepted all of the party's programme, even other steps denounced by the EU and human rights organisations as attacks on the democratic system of checks and balances.
The party says its programme is aimed at removing corrupt officials from state positions.