WARSAW, Poland (AP) " Poland's senators approved legislation Friday that gives the government greater control of a top court and a key judicial body despite warnings from European Union leaders that the move could put the country at risk of losing its EU voting rights.

The measures affecting appointments and other aspects of the Supreme Court and the National Council of the Judiciary are part of a string of policy changes pursued by Poland's ruling Law and Justice party that EU officials have said go against the bloc's fundamental values.

The laws overwhelmingly endorsed by the Senate still need President Andrzej Duda's approval, which he is expected to give.

EU officials could trigger a procedure to strip Poland of its voting rights on Wednesday, when they will be reviewing the new legislation to see if it is in line with European standards of the rule of law.

Hours earlier, lawmakers in the lower house of Poland's parliament, the Sejm, passed much-criticized new rules for local elections that opponents claimed undermine the independence of electoral bodies and fair elections.

Opposition Modern party leader, Katarzyna Lubnauer, said their adoption would mean the "demise of what we call democracy."

The head of the State Electoral Commission, Wojciech Hermelinski, said Friday he will seek a meeting with the president to share his skepticism. Duda and the Senate still need to approve the regulations, but could also question or reject them.

Under the new rules, lawmakers would choose seven out of nine commission members, who are currently chosen by judges. The interior minister would be given authority to appoint election supervisors.

Rules governing the validity of ballots also would be liberalized by allowing voters to correct their choices on the spot. Critics say that opens the door to manipulation.