The evidence showed that Sean Penoncello committed a litany of heinous crimes. He videotaped his sexual assaults of children, then shared them on the internet. He secretly installed cameras at a motel pool dressing room and recorded women and girls as they changed.

The 45-year-old St. Louis County man had little chance at trial. Yet Penoncello pleaded not guilty, requiring his victims to testify at a federal trial in Minneapolis. After a jury convicted Penoncello in 2016, Judge Patrick Schiltz sentenced him to about 33 years in prison, saying the crimes were some of the worst he had ever seen.

But last week Schiltz took a step rarely seen in federal courts — he threw out the sentence he had imposed. In a 29-page order, the judge wrote that Penoncello’s Duluth-based attorney, Craig Hunter, repeatedly misled his client, causing him to reject a plea deal and take a doomed case to trial.

“Hunter failed to fulfill [his] duties to Penoncello,” Schiltz wrote.

Penoncello will still go to prison after accepting the originally offered plea deal, but his minimum sentence will start at 15 years and go to a maximum of 30 years. And unlike after a jury verdict, at his new sentencing hearing, Penoncello can make a more credible argument that he is remorseful for his crimes and accept responsibility in hopes of getting a lighter sentence.

The attorney who represented Penoncello for his appeal, Robert Richman, said only once in his 34-year career has he seen a similar reversal.

“This is extraordinary,” he said.

The U.S. Attorney’s office declined to comment on the case.

Prosecutors indicted Penoncello in March 2015, charging with him one count of producing child pornography. After Hunter was appointed to represent him, he sent his client a letter in May saying that if he was convicted, U.S. sentencing guidelines recommended life in prison for his crime.

“That was not true,” Schiltz wrote.

Instead, the guidelines recommended a 30-year maximum sentence. Penoncello could have gotten out in his 60s — but he never knew that.

To avoid a trial, prosecutors offered him a plea deal. Penoncello rejected it thinking his sentence would be the same no matter how he was convicted. He instead held on to the slim chance that he could be acquitted, even though his attorney knew he would be convicted, Schiltz wrote.

“Penoncello was never told that the evidence against him was overwhelming and that he was certain to be convicted, even though Hunter had himself reached that conclusion,” Schiltz wrote.

Hunter declined to comment, but Richman defended his colleague.

“This was not the case of someone asleep at the switch or derelict in his duties. Even the best lawyers can make a mistake,” he said.

After Penoncello rejected the plea deal, prosecutors filed two additional charges against him, which added another 50 years to the maximum he would have faced if he was found guilty.

Penoncello went to trial, where Schiltz wrote that he put on a “preposterous” defense about “a frame-up that was so complicated that not even the CIA could’ve pulled it off.”

Going to trial only made it worse for Penoncello, Schiltz wrote.

“Had Penoncello pleaded guilty, been honest, and expressed remorse, the Court likely would have imposed a long sentence, but one shorter than 360 months,” Schiltz wrote.

After throwing out the sentence, Schiltz ordered the government to offer Penoncello its original plea deal, which has a maximum of 30 years.

Richman, his new attorney, said his client will accept the offer. At sentencing, he’ll argue for that Penoncello should receive a lighter sentence than 30 years, saying this his client is sorry for his crimes.

He also said he’ll tell the court that Penoncello suffered from abuse as child, “none of which were brought to the judge’s attention at the time of the initial sentencing,” Richman said.

A sentencing date has not yet been set.