In a letter sent to Castillo, who has survived two impeachment votes in 12 months and is the target of five criminal investigations, Torres said he was stepping down “for personal reasons.”
Torres posted a copy of the letter, in which he wished Castillo success, on Twitter.
His resignation will trigger an automatic cabinet reshuffle.
Torres, 79, first served as Castillo’s justice minister, and then took over the prime ministerial portfolio in February after three previous prime ministers had come and gone.
The country has had seven interior ministers since Castillo took over in July 2021 — a high turnover even for a country that is no stranger to political upheaval.
In five days of 2020, Peru had three different presidents.
Leftist Castillo — a rural school teacher who unexpectedly took power from Peru’s traditional political elite in elections last year — has been under nonstop fire from his right-wing rivals.
He also finds himself in the crosshairs of the attorney general’s office, with investigations into alleged public tender corruption and claims that Castillo plagiarized his university thesis.
Opinion polls show that three-quarters of Peruvians disapprove of Castillo’s management of the country.