BUCHAREST (Reuters) - Romania s senate approved on Wednesday part of a judicial overhaul criticized by the European Commission, the United States and the country s own president as a threat to judicial independence. The bill passed by the assembly is one of three that have triggered street protests across the country, a European Union state ranked as one of the bloc s most corrupt, and drawn opposition from thousands of magistrates.  The three bills jointly limit magistrates  independence and set up a special unit to probe crimes committed by magistrates. This makes magistrates the only professional category with a prosecuting unit dedicated to investigating them. The proposed changes mean the country is joining its eastern European peers Hungary and Poland, where populist leaders are also trying to control the judiciary, in defying EU concerns over the rule of law. Lawmakers approved another bill on Tuesday, amending the definition of prosecutor s activity to exclude the word  independent . A third bill is widely expected to be approved on Thursday. The Commission launched an unprecedented action on Poland on Wednesday, calling on other member states to prepare to sanction Warsaw if it fails to reverse judicial reforms it says pose a threat to democracy. Romanian President Klaus Iohannis said there were  obvious risks  that the Commission could do the same in Romania s case if the legal changes take hold.  If someone imagines there will not be consequences, then they are from the moon,  Iohannis told reporters.  There will be consequences, the magnitude depends on the laws  final form.      It could be months before the bills are enforced. Opposition parties plan to challenge them in the Constitutional Court. The president could do the same, as well as send them back to parliament for re-examination, something he can do only once. He could also trigger a country-wide referendum on continuing the fight against corruption.  Romania s ruling Social Democrats, which command an overwhelming majority in parliament together with their junior coalition partner, ALDE, have so far ignored the warnings.  They are also working on changes to the criminal code that critics say will derail law and order. The country s prosecutor general, chief anti-corruption prosecutor and the head of the anti-organized crime unit have all criticized the proposed changes which they said will not only end the anti-graft fight but endanger general safety. Hundreds of magistrates protested in silence this week, lining the steps of courthouses across the country. Romania s anti-corruption prosecution unit has sent 72 members of parliament to trial since 2006. The speakers of parliament s lower house and senate are both currently on trial in separate cases. 