A Bronx judge went rogue on Sunday and ordered the accused Riverdale synagogue vandal held on $20,000 bail — even though prosecutors insisted the man had to be sprung under the state’s controversial bail-reform laws.

Jordan Burnette, 29, was hit with 42 charges, including a number of hate crime-related offenses for allegedly smashing windows at various synagogues and swiping prayer books during an 11-day crime spree.

But none of the charges require him to be held on bail, prosecutors noted at his arraignment in Bronx Criminal Court.

“Given the number of attacks, we probably would have asked for substantial bail before January of 2020,” Assistant District Attorney Theresa Gottlieb told Judge Louis Nock.

“The legislature did not include hate crimes in its revision of bail reform and, under the law as it exists today, this is not eligible,” she added. “We will not violate the law.”

But that didn’t stop Nock from ordering Burnette held on $20,000 bail, $30,000 bond or $30,000 partially secured bond — after deciding that the “shattering of glass” constitutes a violent felony.

“I’ve taken a very close look at the law,” Nock said. “Given the gravity and the number of charges he’s facing, this court is inclined to set bail.”

Earlier in the day, the judge demanded Gottlieb explain why her office wasn’t requesting Burnette, 29, be held on bail, despite his alleged campaign of terror.

different synagogues were vandalized with windows and glass doors smashed with rocks in the Bronx.
Different synagogues were vandalized with windows and glass doors smashed with rocks in the Bronx.
Lev Radin/Pacific Press/Shutterstock

Burnette’s attorney Morgan Everhart appeared shocked over the judge’s unorthodox ruling to keep her client behind bars.

“Your honor, according to the bail law, none of the charges in this case apply,” she said in court. “These are all nonviolent charges.”

“I appreciate your effort. I hope I am correct,” Nock replied before ordering the court adjourned.

Everhart, who could appeal the judge’s decision, didn’t return a message.

Burnette’s trail of destruction began April 21, prosecutors alleged.

They accused him of shattering synagogue doors and windows, smashing multiple car windows — and dousing prayer books from Adath Israel in hand sanitizer before tossing them in the woods nearby.

Conservative Synagogue Adath Israel of Riverdale where glass doors were smashed.
The Conservative Synagogue Adath Israel of Riverdale where glass doors were smashed.
Lev Radin/Pacific Press/Shutterstock

Burnette was nabbed cycling against traffic and told investigators that he was stopped “because it’s a Jewish neighborhood.” The bike Burnette was riding turned out to be stolen from one of the synagogues, prosecutors said. 

Attacks that cause no injury are ineligible for bail in New York as part of the reforms that went into law last year — allowing suspects of more than 400 nonviolent offenses to walk free without having to post a dime to ensure their return to court.

Ohel Menachem Riverdale Jewish Youth Library Lubavitch where glass windows were smashed
Police stand guard in front of Ohel Menachem Riverdale Jewish Youth Library Lubavitch where glass windows were smashed.
Lev Radin/Pacific Press/Shutterstock

Those offenses include most misdemeanors and even some felonies, ranging from criminally negligent homicide to selling drugs on or near school grounds, The Post previously reported.

Police stand guard in front of the synagogue and NYPD's Hate Crime Task Force is investigating the incidents.
Police stand guard in front of Riverdale Jewish Center.
Lev Radin/Pacific Press/Shutterstock

Last month, Nock had decried the state’s bail laws when he was forced to release a suspect charged in the hate-crime assault of an undercover Asian cop.

“My hands are tied because under the new bail rules, I have absolutely no authority or power to set bail on this defendant for this alleged offense,” the jurist said at the time.

Burnette’s mother and sister, who were both present in court, declined to speak to The Post following the judge’s ruling.

NYPD's Hate Crime Task Force is investigating the incidents
NYPD’s Hate Crime Task Force is investigating the incidents.
Lev Radin/Pacific Press/Shutterstock