Brazil's political crisis has deepened as a judge blocked the appointment of former president Luiz Inacio Lula da Silva as chief of staff to his successor moments after his tumultuous swearing-in ceremony held amid heated protests.

Brazil's political crisis has deepened as a judge blocked the appointment of former president Luiz Inacio Lula da Silva as chief of staff to his successor moments after his tumultuous swearing-in ceremony held amid heated protests.

Current President Dilma Rousseff's opponents accused her of a transparent manoeuvre aimed at helping the once popular Mr Silva avoid legal woes that saw him taken in for questioning in a sprawling corruption probe less than two weeks ago. Cabinet members cannot be investigated, charged or imprisoned unless authorised by the Supreme Court.

Ms Rousseff has insisted the cabinet appointment has nothing to do with the former president's legal problems, saying Mr Silva would help put the country back on track economically and spearhead the fight against attempts to oust her over allegations of fiscal mismanagement.

The impeachment process moved a step closer on Thursday as the lower house established a special commission on the matter.

The simmering anger that bought about three million people on to the streets in nationwide anti-government demonstrations over the weekend again spilled over, with protests flaring in Brasilia and Sao Paulo, where demonstrators brandished inflatable dolls of Mr Silva in black-and-white prison stripes.

Ms Rousseff went on the offensive at the swearing-in ceremony, accusing Sergio Moro, the judge who is leading the corruption probe at the state-run oil company Petrobras, of violating the constitution and acting in a partisan manner.

The injunction suspending Mr Silva's nomination, brought by a federal judge in Brasilia, was widely expected as such tactics are often used to delay or interrupt political appointments and decisions. But the practical effects remain subject to debate, with some lawyers insisting Mr Silva is the chief of staff - and enjoys the special legal standing afforded by the role - while others contend the injunction must first be ruled on by a higher court.

Ms Rousseff and Mr Silva have repeatedly denied any wrongdoing, but she has seen her popularity nosedive as the country of 200 million has spiralled into crisis after crisis.

The Petrobras corruption investigation has stained Brazil's political and business elite. The country is ground zero for the Zika virus, which scientists believe can lead to birth defects. The economy is mired in the worst recession since the 1930s, with rising inflation and daily announcements of layoffs adding to people's fears and desperation. And in the middle of it all, Brazil is set to host the Summer Olympics in Rio de Janeiro in August.