A judge ruled Thursday that federal prosecutors, including future Labor Secretary Alexander Acosta, violated the law when they did not tell victims that the government had struck a deal not to prosecute Jeffrey Epstein, a politically connected billionaire accused of molesting dozens of young girls.

The ruling was a stinging rebuke for prosecutors in a grim, high-profile case that has drawn increased scrutiny in recent months. A Miami Herald investigation last year highlighted the allegations and Acosta’s role in cutting a non-prosecution agreement with Epstein, while a Justice Department office said it is ex­ploring whether the federal prosecutors who reached the deal committed “professional misconduct.”

District Judge Kenneth Marra was blunt, ruling that prosecutors had acted improperly in reaching the agreement with Epstein — which stopped federal action in exchange for him pleading guilty to a state charge — without telling the victims. Marra, based in West Palm Beach, Fla., wrote in a 33-page ruling that the actions violated the Crime Victims’ Rights Act (CVRA), which entitles victims to know about significant events in their cases.

Marra wrote that he was “not ruling that the decision not to prosecute was improper,” noting that he was “simply ruling that, under the facts of this case, there was a violation of the victims’ rights under the CVRA.”

Prosecutors did not give victims a chance “to affect prosecutorial decisions” and did not accurately tell them about what was happening, Marra wrote. Prosecutors sought “to conceal the existence” of the deal cut with Epstein “and mislead the victims to believe that federal prosecution was still a possibility,” he wrote.

“While the government spent untold hours negotiating the terms and implications of the NPA [non-prosecution agreement] with Epstein’s attorneys, scant information was shared with victims,” Marra wrote. “Instead, the victims were told to be ‘patient’ while the investigation proceeded.”

An attorney for Epstein did not respond to a request for comment about Marra’s ruling. The Labor Department pointed to the Justice Department’s long-standing defense of how prosecutors handled the case.

“For more than a decade, the actions of the U.S. attorney’s office for the Southern District of Florida in this case have been defended by the Department of Justice in litigation across three administrations and several attorneys general,” a spokesperson for the Labor Department said Thursday. “The office’s decisions were approved by departmental leadership and followed departmental procedures.”

They added that the case remains in active litigation and referred further questions to the Justice Department. The U.S. attorney’s office in the Southern District of Florida, which Acosta led between 2005 and 2009, declined to comment on the ruling.

Brad Edwards, an attorney representing some of the victims in the case, hailed the judge’s decision.

“It’s a clear victory, vindicating our clients and verifying exactly what we have been saying for over a decade,” he wrote in an e-mail. “The government clearly violated the rights of dozens of victims and then sadly fought those same victims for 10 years trying to defend the improper agreement they constructed with Mr. Epstein.”

The allegations against Epstein and the fact that he had reached a deal had been publicly known, coming up during Acosta’s 2017 confirmation hearings to lead the Labor Department. The case surged back into the public eye in November, when the Herald published its investigation reporting that it had identified approximately 80 women who said they had been sexually abused by Epstein between 2001 and 2006. The Herald report also detailed how Epstein had struck a deal that effectively ended an FBI probe.

Before the Herald’s report, Acosta’s name had been floated as a possible future attorney general in the Trump administration. After it was published, lawmakers responded with a wave of calls for an investigation into what happened.

Sen. Ben Sasse, R-Neb., who chairs the Senate Judiciary Oversight Subcommittee, said he hoped the Justice Department uses the ruling to revisit its agreement with Epstein.

“Jeffrey Epstein is a monster and his victims deserve justice,” Sasse said in a statement Thursday.

“I’m relieved that the court agrees that it was wrong to hide this child rapist’s pathetically soft deal from his victims, in violation of federal law. The fact that it’s taken this long to get this far is heartbreaking and infuriating,” he said.