BUCHAREST (Reuters) - Romanian lawmakers voted on Tuesday to enact judicial changes that critics say will undermine graft investigations by weakening the president’s oversight.

The move brings the country, ranked as one of the bloc’s most corrupt, in line with eastern European Union peers Hungary and Poland in defying EU concerns over the independence of judiciaries and the rule of law.

Ruling Social Democrat senators approved the bill by 80-0 with all opposition groupings boycotting the vote. It now goes to the president, who has expresses scepticism about it.

He can sign it or send it back for more discussion. The opposition, however, has already said it plans to contest the bill at the constitutional court, which could prolong its adoption by early 2018.

Contested elements of the bill include weakening the president’s right to vet prosecutor candidates, as well as amending the definition of prosecutors’ activity to exclude the word “independent.”

“The president can refuse to appoint (prosecutors) only once...,” reads the bill.

“Prosecutors carry out their work according to the principles of legality, impartiality, hierarchical control, under the authority of justice minister. Prosecutors are independent in proposing solutions,” the bill stipulates. Critics say this amounts to political control.

The bill also refers to the finance ministry’s obligation to recoup losses triggered by a judicial error from the judge who issued the sentence, instead of from state funds. Experts have said this would could distort court judgments.

The bill is are part of a wider judiciary overhaul that has triggered street protests across the country in recent weeks.

Romanian prosecutors have investigated thousands of public officials in an unprecedented crackdown on graft in recent years. The lower house and senate speakers, both leaders of the ruling coalition, are on trial in separate cases.