As news of Mr. da Silva’s appointment spread Wednesday night, protests erupted across Brazil. Several continued Thursday, and they follow Sunday’s demonstrations against Ms. Rousseff’s government. Tear gas was used on Thursday to disperse protesters gathered outside the presidential palace.

Shortly after Mr. da Silva was sworn in, a federal judge ordered the suspension of his appointment. The immediate effect of the order was unclear. The government said it planned to appeal. Brazil’s Supreme Court said it would hear the case “soon.”

Late Wednesday, the federal judge who oversees the Petrobras investigation released dozens of recordings of phone calls between senior political leaders linked to the corruption probe, including a recording of a call between Ms. Rousseff and Mr. da Silva. That call, in which Ms. Rousseff told Mr. da Silva that she was sending a document to him to prove he officially occupied the chief-of-staff post ahead of the swearing-in ceremony, has fueled the perception among Ms. Rousseff’s critics that the appointment was made to protect Mr. da Silva. Ms. Rousseff challenged the legality of the tapes’ release.

Efforts to impeach Ms. Rousseff gained steam on Thursday when members of Congress approved the creation of a special commission to hear the impeachment request. Ms. Rousseff is alleged to have used accounting tricks to mask a growing deficit, allegations which she denies. Separately, Ms. Rousseff was this week directly implicated in the Petrobras corruption scandal for the first time since the scandal broke open roughly two years ago. A Brazilian senator implicated in the scandal told prosecutors that Ms. Rousseff knew of wrongdoing at Petrobras when she was board chairwoman. She denies wrongdoing.