WARSAW, Poland (AP) — Thousands of protesters across Poland demonstrated against new legislation being debated by senators that gives the ruling party control over courts and a key judicial body.

The legislation on the Supreme Court and a national judicial council was passed last week by the lower house of parliament and now needs the approval of the Senate and of President Andrzej Duda who had given it the basic shape.

European Union leaders and Poland's opposition parties say the legislation threatens Poland's rule of law.

Some 2,000 gathered in front of the Presidential Palace in Warsaw with candles, the symbol of support for independent courts, to ask Duda to veto the legislation, just as he did with its previous version.

Protests were also held in many other cities.