The Supreme Court said Tuesday it accepted a plea agreement with the former Senate leader for the governing Workers' Party, whose testimony in the sprawling Petrobras corruption case includes incendiary allegations against Brazil's president, her predecessor and other prominent public figures across the political spectrum.

Sen. Delcidio do Amaral was detained late last year on allegations of obstructing the "Car Wash" investigation into corruption at Brazil's state-run oil giant, Petrobras. He was released in February, but news reports emerged last week saying he had struck a plea deal in exchange for leniency.

Supreme Court officials on Tuesday confirmed to the Associated Press that Amaral's deal had been accepted and made public. The court sent a link to the 400-plus page document.

In the document, Amaral detailed accusations against President Dilma Rousseff including that she knew about a scheme to buy a refinery in the United States at an inflated price.

It also alleges Rousseff and former Justice Minister Jose Eduardo Cardozo appointed a justice to a high court in a bid to secure the release of some people detained in the Petrobras probe. The justice, Marcelo Navarro, was approved by the Senate, but he didn't release anyone detained in the case.

Amaral's accusations are the first directly implicating Rousseff herself in the corruption scheme. She has repeatedly denied any wrongdoing.

His testimony is considered only a starting point in the investigation, with its contents to be verified. If it was found he lied, the plea agreement would be annulled.

The document also alleges that Education Minister Aloizio Mercadante, a close confident of Rousseff who had been her chief of staff until recently, warned Amaral to "remain calm and think about the tack he would take" following his Nov. 25 detention.

The message, a recording of which was part of the plea deal, was transmitted to Amaral during his time in jail through an aide, who said Mercadante offered money to help pay legal fees "probably through companies linked with the Workers' Party," according to the document. Amaral said he assumed Mercadante was acting as Rousseff's "emissary."

At a news conference Tuesday afternoon, Mercadante acknowledged speaking with Amaral's aide, but categorically denied offering any payment or trying to interfere in the investigation. He said that he felt sorry for Amaral's family following his detention and that "human generosity" motivated his conversation with the aide. He insisted Rousseff was not aware of the conversation.

In a brief statement, Rousseff's office said she "rejected with vehemence and indignation the attempt to connect her with the personal initiative by Minister Aloizio Mercadante."

Amaral's plea deal also includes accusations against Rousseff's predecessor and mentor, Inacio Lula da Silva, a once wildly popular president who governed Brazil in 2003-2011. Amaral alleges Silva ordered him to make payouts to another key operator of the Petrobras scheme to protect a close friend.

Silva has repeatedly denied any wrongdoing.

The document also contains dozens of other accusations against prominent officials, including Vice President Michel Temer, former and current Cabinet members, leaders of political parties, senators, high court justices, Petrobras top brass and businessmen.

It includes allegations that the president of the Senate, Renan Calheiros, and other senators from the PMDB party, which is allied with the Workers' Party, strong-armed the administration into appointing their candidates to government agencies from which bribes were extracted.

The document also alleges that Aecio Neves, who narrowly lost to Rousseff in the 2014 presidential run-off, received bribes from a corruption scheme at the state-run Furnas electric company. Charismatic Rio de Janeiro Mayor Eduardo Paes is mentioned in connection with a separate alleged corruption scheme. Amaral said Paes had a role in erasing bank records belonging to Neves.

Under the deal, Amaral will have to return 1.5 million reais ($402,000) to the public coffers.

Amaral's office said that only Amaral or his adviser could comment on the plea deal, but neither was immediately available.

In a brief letter Tuesday to regional Workers' Party leadership, Amaral announced he was leaving the party after more than a decade of membership. He is still facing procedures in the Senate that could strip him of his seat, but for the moment he remains a senator.

The announcement of the plea deal comes amid widespread rumors suggesting Rousseff was on the verge of appointing Silva to a Cabinet position.

Critics have blasted such a move, saying it would be transparently aimed at helping shield the former leader from possible detention during the corruption investigations. Members of the Workers' Party counter that Silva's appointment would be aimed at helping Rousseff fight impeachment proceedings over allegations of fiscal mismanagement.

Rumors of Silva's possible appointment surfaced after the former leader was spirited to a police station earlier this month to answer questions in the Petrobras investigation. Such an appointment would afford Silva "privileged jurisdiction" as only Brazil's Supreme Court can authorize the investigation, imprisonment and trial of Cabinet members.

Tuesday's revelations came on the heels of nationwide protests against Rousseff and the Workers' Party that brought an estimated 3 million people onto the streets Sunday. Newspapers called them the biggest political demonstrations in Brazilian history.

Rousseff has been beset not only by fallout from the Petrobras scandal, but also by rising unemployment and the worst recession in decades.

___

Associated Press writer Stan Lehman in Sao Paulo contributed to this report.