RIO DE JANEIRO — Former President Dilma Rousseff on Wednesday called the prosecution of her predecessor on corruption charges another attack on Brazil’s democracy, speaking just weeks after the Senate removed her from office in an impeachment trial.

Rousseff spoke in support of her mentor, Luiz Inacio Lula da Silva, a day after a federal judge ruled that he must stand trial on corruption and money-laundering charges, possibly thwarting the political comeback of one of the remaining dominant forces of Latin America’s left. A conviction could ruin his chances of running for president again in 2018 and returning the leftist Workers’ Party to power.

“Brazil is going through a very difficult moment. A process is underway that is systematically breaking the constitution,” Rousseff told supporters at a rally for Rio de Janeiro mayoral candidate Jandira Feghali. “First they attacked me, and now they are attacking Lula.”

Prosecutors accuse Silva of taking bribes from a construction company in exchange for contracts with the country’s big state-run oil company, Petrobras.

Investigators charge that the company OAS bought a beachfront apartment in the city of Guaruja in Sao Paulo state for Silva and his wife, decorating and furnishing it to their taste. The politician has denied any wrongdoing, saying he didn’t own the penthouse and only visited it.

Silva, who governed from 2003 to 2010, is still a popular contender for president, leading in a July poll for the 2018 race, even after he had been implicated in the corruption scandal.

Rousseff was never personally implicated in the kickback scheme at Petrobras, but many accused her of trying to protect Silva as prosecutors unraveled his alleged role. Much of the graft happened during Silva and Rousseff’s combined 13 years in power.

The investigation into billions of dollars in alleged kickbacks at Petrobras has led to the jailing of several businessmen and politicians.

Impeached for breaking fiscal laws in managing the government’s budget, Rousseff had grown hugely unpopular as the corruption investigation widened while the economy slumped over the past two years into its deepest recession in decades. Under Silva, Brazil had seen extraordinary economic growth, which helped lift 20 million people from poverty and elevate the country’s voice in the global landscape.

Associated Press videojournalist Renata Brito contributed to this report.