The chief justice of Brazil's Supreme Federal Court quickly overturned a lower court ruling Wednesday that could have opened the way for former President Luiz Inacio Lula da Silva to get out of jail.

Federal Court Judge Marco Aurelio had ruled that prisoners serving sentences but appealing are constitutionally entitled to freedom, though he also said cases would have to be reviewed by the relevant presiding judge to determine if an inmate was eligible.

Lawyers representing da Silva rushed to submit a petition seeking the immediate release of the former leader, who has been in prison since April after being convicted on charges that during his 2003-2010 administration he accepted bribes in exchange for favoring specific companies. Da Silva maintains his innocence and is appealing the conviction.

The president of the high court, Dias Toffoli, dashed da Silva's hopes several hours later by throwing out Aurelio's ruling at the request of Attorney General Raquel Dodge.

Dodge released a statement earlier criticizing Aurelio's decision, saying that keeping those convicted in prison "is necessary to contribute to the end of impunity, and ensure the credibility of government institutions."

President-elect Jair Bolsonaro, a hard-right politician who takes office Jan. 1, took to Twitter to congratulate Toffoli for overturning the decision. Bolsonaro said it would have benefited tens of thousands of prisoners and put Brazil at risk.

Da Silva is the defendant in nine cases related to the mammoth "Car Wash" corruption investigation that has upended Brazilian politics, leading to da Silva's leftist Workers Party losing power as well as numerous business executives and top politicians from a variety of parties ending up in prison.

Back and forth rulings of this type have become common in Brazil, where many people see the justice system as becoming highly politicized with courts playing ideological favorites.

"This type of ruling brings a strong component of instability and political radicalization to the Supreme Court," said Mauricio Santoro, a political scientist at Rio de Janeiro State University. "We have seen over the last months both the left and the right accusing the Supreme Court of becoming heavily politicized and interfering in areas that are outside its purview."