Brazil has formally charged two former presidents, Dilma Rousseff and Luiz Inacio Lula da Silva, with racketeering for plotting to skim funds from Petrobras, the state-owned oil firm.

Brazil's top prosecutor, Rodrigo Janot, alleged on Tuesday that eight members of the Workers Party, including Lula and Rousseff, committed a series of crimes involving Petrobras, including cartel formation, corruption and money laundering.

They were the first criminal charges to be levelled against Rousseff, who was impeached in 2016 for breaking budgetary laws.

The news was particularly bad for the uphill battle Lula is waging to win the presidency again.

Lula, who is still Brazil's most popular politician, is appealing a corruption conviction that would bar him from running for president in 2018.

He faces four other corruption trials.

Rousseff was Lula's designated successor and Brazil's first female president.

"The crimes are believed to have taken place at least from mid-2002 to May 12, 2016" when Rousseff was suspended as part of impeachment proceedings, the attorney general's office said.

Their Workers' Party allegedly pocketed $475m in bribe money, "making use of public entities including Petrobras, the National Development Bank (BNDES) and the Planning Ministry", according to the charges.

Janot alleged that much of what became a transnational corruption operation was run by Lula.

Lula's lawyer said the law was being misused to persecute the former president.

READ MORE: Dilma Rousseff - Impeachment is a coup

In a statement, the Workers Party said the charges were baseless and being used to divert attention from other investigations, including one into a former federal prosecutor, referring to a case Janot announced on Monday.

A representative for Rousseff said the prosecutor's office offered no evidence of the crimes and called on the Supreme Court to guarantee the right to defend against them.

The charges arise from the Operation Car Wash investigation that uncovered a cartel of companies paying bribes to officials to secure Petrobras contracts, revelations that have spawned a host of investigations that has shaken Brazil's political system and economy.

Dozens of senior leaders across the political spectrum and high-ranking businessmen have been investigated or convicted since the sprawling corruption scandal broke in 2014.