Romania's parliament voted through controversial changes to the penal code on Wednesday, a move condemned by President Klaus Iohannis as "dictatorship of the majority".
In a fast-paced process rarely seen in the east-european country, the amendments cleared all the parliamentary procedures in less then a week and were passed by a margin of 168 to 97 in the lower chamber plenary.
The left-wing ruling coalition argues that the changes, which partially decriminalise abuse of office, are needed to stop "abuses" from part of the judiciary.
However the centre-right opposition, to which Iohannis belongs, has slammed the move as an attempt to overturn a prison sentence given to Liviu Dragnea, the powerful leader of the ruling Social Democratic Party (PSD).
"What we've seen these days is called dictatorship of the majority and is profoundly harmful for democracy", Iohannis said in a statement.
The European Commission voiced concern at the reforms and said it wouldn't hesitate to act if Romania's legislation does not conform with European and international norms.
Romania's public prosecutor Augustin Lazar also criticised the penal reforms, which he said had been "made in conformity with the attitudes and vices of the defendants, not by EU standards".
Romania is one of the EU's most graft-ridden countries and prosecutors have launched a crackdown on corrupt officials in recent years.
Anti-corruption investigators said more than 200 abuse of office cases could be scrapped under the new penal code.
Last week 12 Western nations issued a joint warning that the judicial reforms proposed by Romanian lawmakers could "impede international law enforcement cooperation".
Dragnea, widely seen as the most powerful politician in the country, was sentenced last month to three-and-a-half years in prison over a fake jobs scandal, a decision he has appealed.
He could not serve as prime minister because of a previous conviction, in 2016, for vote-rigging.
"Do you think they will let me get away? Let's be serious," Dragnea told reporters on Tuesday, when asked whether the law change could keep him out of jail.
Under the changes, abuse of office is no longer a crime if prosecutors can't prove that the defendant committed the deed for his own benefit or that of close relatives.
Also, an official who makes less then 1,900 lei (407 euro) as a result of a crime will not be prosecuted. Maximum jail time is also reduced from seven to five years for this offence.
President Iohannis and the opposition said they would challenge the bill in the constitutional court.
At the beginning of 2017, shortly after winning power, the PSD tried to push through legal reforms widely seen as aimed at helping Dragnea with his previous legal troubles.
However, that move sparked the biggest wave of protests since the fall of communism, forcing the government to back down.