Brazilian President Dilma Rousseff named her predecessor Luiz Inacio Lula da Silva as chief of staff on Wednesday, giving him legal protection from bribery charges, while a judge sought to block the move.
Soon after his swearing-in ceremony on Thursday, a federal judge in capital Brasilia suspended the appointment on the grounds it prevented "the free exercise of justice."
"I hereby interrupt the nomination of Mr Luiz Inacio Lula da Silva to the position of chief of staff or any other that grants him immunity," Judge Itagiba Catta Preta said in the preliminary ruling, which must still be reviewed by a higher court and can be appealed.
In Brazil, cabinet ministers can only be tried before the Supreme Court.
State prosecutors in Sao Paulo filed for his arrest last week after charging him with money laundering for concealing ownership of a luxury seaside apartment, which he denies.
They asked Judge Sergio Moro, who oversees a corruption investigation into state-run oil company Petrobras, to take over Lula’s case, saying the two cases are connected.
Judge Moro also publicised taped phone conversations on Wednesday showing Lula and Rousseff tried to influence prosecutors and courts in favour of the former president. Yet he stressed in his court filing that there was no indication those attempts resulted in inappropriate actions.
"Democracy in a free society requires that the governed know what their leaders do, even when they try to act in the protected shadows," Moro said, defending the release against government backlash.
After Rousseff’s announcement and the release of records, police said 2,000 demonstrators gathered in the capital Brasilia outside the presidential palace, calling for her resignation and Lula’s arrest.
Thousands more gathered in Sao Paulo, the country’s financial capital, where over one million people has gathered on Sunday.
On social media networks, critics quoted Lula's own words against him, "In Brazil, when a poor person steals, he goes to prison. When a rich person steals, he becomes a cabinet minister!"
Lula was hugely popular when he stepped down five years ago at the height of an economic boom. Now he returns with a charge with money laundering in a case linked to the Petrobras scandal.
The opposition was quick to slam the appointment.
"Instead of explaining himself and assuming his responsibilities, former president Lula preferred to flee out the back door," said lawmaker Antonio Imbassahy, lower house leader for opposition party PMDB.
"It's a confession of guilt and a slap to society. President Dilma, by appointing him, has become his accomplice," Imbassahy added.
"The final chapter in this story will be her impeachment."
Rousseff defended Lula’s appointment, saying he was chosen for his experience.
"Lula's arrival in my government strengthens it and there are people who don't want it to be stronger," she said in a press conference.