Former Assembly Speaker Sheldon’s effort to have his corruption indictment tossed from federal court was denied on Friday by a U.S. district court judge.

But in the same order, Judge Valerie Caproni took U.S. Attorney Preet Bharara to task for comments made in the wake of Silver’s arrest that were critical both of the state’s political system and Albany lawmakers.

Silver’s attorneys had sought the longtime former speaker’s case dismissed following the Manhattan Democrat’s indictment on fraud and corruption charges stemming from allegations that he masked bribes as legal referrals.

Silver remains a rank-and-file member of the chamber after losing the speaker’s post to Bronx Democrat Carl Heastie.

In the wake of Silver’s arrest, Bharara would criticize Albany’s penchant for secrecy, the spate of corruption arrests involving state lawmakers and the budget process.

A motion to dismiss the case from Silver’s legal team cited Bharara’s comments as potentially be prejudicial for potential jury members in an upcoming trial.

While Caproni tossed the dismissal motion, she added in the ruling that Bharara wasn’t without fault.

“In particular, the Court is troubled by remarks by the U.S. Attorney that appeared to bundle together unproven allegations regarding the Defendant with broader commentary on corruption and a lack of transparency in certain aspects of New York State politics,” she wrote.

It’s a rare public rebuke for Bharara, who has become infamous in state political circles for his prosecution of state political leaders as well as his investigation into Gov. Andrew Cuomo’s decision to close the Moreland Commission on Public Corruption following an agreement on ethics reform measures.

Bharara has been criticized by some lawmakers for his ability to generate press stemming from his corruption arrests and what some consider to be remarks critical of Albany’s governance that are inappropriate for a prosecutor to make.

In one forum, Bharara mocked the so-called “three-men-in-a-room” negotiations for the state budget — which Silver took part in while speaker — and compared the process to a sitcom.

Caproni, in her dismissal, wrote that such comments cannot be “magically dispelled by sprinkling the words “allege(d)” or “allegation(s)” liberally throughout the press conference or speech, or by inserting a disclaimer that the accused is “innocent unless and until proven guilty” at the end of an otherwise improper press release.”

Still, despite the admonition, Caproni dismissed more narrow concerns raised by Silver’s lawyers including the claim the U.S. attorney’s office tipping off The New York Times in advance of the January arrest finding “little merit” in the claim that could he swayed potential jurors.

Silveropinionandorder (1) by Nick Reisman