A New Jersey judge has received death threats after saying a teenager accused of raping an intoxicated 16-year-old girl should get leniency because he comes from “a good family,” according to a report.

Judge James Troiano of Monmouth County Superior Court sparked a backlash last year when he denied a prosecution request for the 16-year-old suspect to be tried as an adult.

“This young man comes from a good family who put him into an excellent school where he was doing extremely well,” he said at the time. “He is clearly a candidate for not just college but probably for a good college.”

Amid a nationwide outcry, Troiano, 69, has received threats of violence — including rape and death — for his stance, as politicians and members of the public call for his removal from the bench, according to the New York Times.

“The whole country, including your fellow judges and judges superior to you, are telling you that you’re a bigot and a detriment to this country,” read one email that a source shared with the Times.

The missive included the hope that a family member of the judge be raped “by a man stronger than you.”

Troiano’s family, including his wife of 40 years, Debbie, and his son, Matthew James Troiano, a former prosecutor in Morris County, also have received threats, according to the newspaper.

Prosecutors said the teen — identified in court papers as G.M.C. — sexually assaulted the girl while at a booze-fueled party packed with about 30 other adolescents.

The boy recorded his attack on the visibly drunk girl on a cellphone, then sent the sickening clip to several friends, according to prosecutors — and days later, texted his pals: “When your first time having sex was rape.”

Last month, an appeals court overturned Troiano’s decision, allowing the case to be moved from Family Court to a grand jury.

Family Court hearings are normally closed to the public, but some of Troiano’s comments in his sealed decision were revealed when the appellate court decision was made public.

In its ruling, the court warned the judge against showing bias toward privileged teens.

Amid online petitions against Troiano, who was labeled a “menace,” he has come under fire from elected officials, including Assemblywoman Valerie Vainieri Huttle, a Bergen County Democrat, and Loretta Weinberg, the New Jersey Senate majority leader.

On Monday, Stephen M. Sweeney, the Democratic president of the Senate, called for the judge’s ouster based on an “egregious absence of clear judgment.”

US Sen. Cory Booker, who is running in the Democratic presidential primary, also weighed in.

“Not only should this judge no longer serve — as he is clearly incapable of properly fulfilling his duties — but across the country, we must call out bad actors in the system, exposing their biases, and show women and survivors that we will doggedly pursue justice on their behalf,” he said in a statement.

The Monmouth County Prosecutor’s Office is still considering its next steps.

“While we have the utmost respect for the Family Court and the judge in this case, we are grateful that the Appellate Division agreed with our assessment that this case met the legal standards for waiver to Superior Court,” county Prosecutor Christopher Gramiccioni said in a statement.

“As with all cases, we are assessing our next steps, which will include discussions with the victim and her family.”

Last week, Troiano refused to comment when approached by The Post outside his home.

“I cannot talk about this. I know very much about it. I know all the stories. I can’t say anything,” he said.