Updated

Poland's president says he will veto two contentious bills that are widely seen as assaults on the independence of the judicial system and are part of a planned legal overhaul by the ruling party that has sparked days of nationwide protests.

In announcing his decision Monday, Andrzej Duda broke openly for the first time with Jaroslaw Kaczynski, leader of the ruling Law and Justice party. Duda is closely aligned with the party and has supported its agenda since taking office in 2015.

Duda said he would veto two of three bills recently passed by lawmakers. One would have put the Supreme Court under the political control of the ruling party, giving the justice minister, who is also prosecutor general, power to appoint judges.

Duda said a prosecutor general should not have such powers.