A top judge in Brazil filed an injunction Friday night blocking former President Luiz Inacio Lula da Silva from becoming chief of staff to President Dilma Rousseff, minutes after the ex-president rallied tens of thousands of supporters behind Rousseff.

Judge Gilmar Mendes granted the injunction requested by the Popular Socialist Party, the country's state-run news agency, Agencia Brasil, said. According to local media, Mendes said Rousseff's decision to name the man known simply as Lula her chief of staff appeared designed to shelter him from prosecutors' charges of money laundering.

Lula's appointment as chief of staff means only the Supreme Court can investigate him, placing him beyond the reach of a massive graft probe investigating corruption at state oil company Petrobras.

An earlier injunction barring Lula from becoming chief of staff was overturned Thursday, as a legal tug-of-war gripped the nation.

Streets of major Brazilian cities filled again with protesters through most of the week with violent protests breaking out at places. State-run news reported that police used rubber bullets, tear gas and pepper spray to break up protesters who had been throwing cans outside the Presidential Palace in Brasilia.

However, Friday’s decision to suspend Lula from ministerial office can be appealed before a plenary session of the court, signaling more court battles may follow before the once wildly popular Brazilian leader gets a seat in Rousseff’s cabinet.