Updated

The head of Peru's judicial branch resigned Thursday in the wake of a mounting corruption scandal involving secret phone recordings capturing numerous judges making behind-the-scenes deals on everything from promotions to criminal sentences.

The latest scandal to embroil this South American nation has ensnared some of the country's highest-ranking judges and political officials and comes just four months after then-President Pedro Pablo Kuczynski stepped down in a separate corruption probe.

In a short letter shared on Twitter, judicial chief Duberli Rodriguez announced he was tendering his resignation "due to the institutional crisis."

The judicial misconduct became public two weeks ago when the Peruvian investigative news website IDL-Reporteros and the "Panorama" new analysis television show published a series of telephone recordings involving an extensive network of judges, businessmen and local authorities describing back-room deals.

In one recording, judge Cesar Hinostroza was caught talking with an unidentified person about the suspect in the rape of an 11-year-old girl.

After asking the child's age and whether she had been "deflowered," Hinostroza promises to investigate. Then he asks: "What do you all want? For the sentence to be reduced or be declared innocent?"

It remains unclear whether the suspect was actually let off, but in the past Hinostroza has acquitted three other suspects accused of raping minors. Hinostroza managed to ascend to the country's Supreme Court despite accusations of previous misconduct, including having allegedly plagiarized his thesis and a book that bears his name. He has now been suspended.

Other recordings describe members of powerful judicial commissions helping judges and prosecutors get promotions over more well-qualified candidates, apparently maneuvering with tactics like asking candidates irrelevant questions during interviews. In one video, candidates for a chief prosecutor position were asked how to prepare duck ceviche, a traditional Peruvian dish.

The records have struck a nerve in Peru, a country where three out of the last four presidents are embroiled in Latin America's biggest graft scandal.

Kuczynski resigned in March after opposition lawmakers revealed that when he was a Cabinet minister his private consulting firm had accepted payments from Odebrecht, the Brazilian construction company accused of paying millions in bribes. He denied any wrongdoing, saying he had removed himself from the company when the payments were made.

The latest scandal has provoked scattered protests around Peru and frustrated citizens called for a march in the capital Thursday night. Polls say 80 percent of Peruvians disapprove of their country's justice system. Aside from the judicial branch chief, the minister of justice and the head of an important commission for judges have also resigned.

At a public event Thursday, President Martin Vizcarra remarked that the country has institutions that "don't deserve the public's trust," and that perhaps an even greater problem is there still appears to be a considerable amount of indifference to combat it.