A New Jersey family court judge has been strongly criticized by the state’s appeals court after he declined prosecutors’ request for a teen accused of raping a visibly intoxicated 16-year-old girl to be tried as an adult.

Judge James Troiano of Superior Court was sharply rebuked by the appeals court not just for his decision in the case, but for the rhetoric he used in his ruling last year. In Troiano’s ruling, which recently became public in the appeals process, he said the teen who is accused of filming his alleged rape and sharing the video with friends was an Eagle Scout who came from a “good family” and was doing “extremely well” at an “excellent school.”

Prosecutors said the 16-year-old boy, identified only as “G.M.C.” in court documents, filmed himself penetrating the girl, also 16, from behind, showing her bare torso and her head hanging down in a darkened room. The teens were at a “pajama-themed party where alcohol was consumed” with about 30 others, according to the appeals court document. G.M.C. was drunk and the victim was “visibly drunk,” slurring her speech and stumbling as she walked. Days after the incident, the boy is alleged to have texted his friends a clip of the encounter as well as the message, “When your first time having sex was rape.”

Although the teen himself characterized the incident as rape, Troiano said in his ruling that he didn’t think the case qualified as a “traditional” rape, noting that he draws a “distinction” between rape and sexual assault. Troiano said he believes rape generally occurs with the involvement of two or more males using a gun or weapon to force a person into an abandoned area and “just simply taking advantage of the person as well as beating the person, threatening the person.”

He denied the Monmouth County Prosecutor’s Office’s waiver to try the teenager in adult court, saying the incident did not occur under such “egregious” conditions. The prosecutor’s office recommended the case be tried in adult court in September 2017, according to the New York Times.

According to the Rape, Abuse & Incest National Network, eight out of ten rapes are committed by a person known to the victim, and 90% of rapes are perpetrated by one person.

Troiano also allegedly downplayed the motivation behind the teen’s alleged texts: “Do I believe that it shows in any way a calculation or cruelty on his part or sophistication or a predatory nature? No, I do not.” He also expressed concern about the “devastating effect” a waiver to try G.M.C. in adult court would have on the boy’s life, citing extraneous details about his activities — including that he was an Eagle Scout — as well as his academic success.

“He is clearly a candidate for not just college but probably for a good college,” Troiano said. “His scores for college entry were very high.”

A spokesperson for the New Jersey administrative office of the courts declined comment to TIME on Troiano’s behalf. Mitchell J. Ansell, a lawyer for the boy, did not respond to TIME’s request for comment.

In its 14-page ruling strongly criticizing Troiano’s decision, the state appeals court has opened a path for the case to move to a grand jury from family court, where G.M.C. would be tried as an adult. Under New Jersey law, a person as young as 15 can be tried in adult court in instances of serious crimes.

Monmouth County Prosecutor Christopher Gramiccioni told TIME he was grateful the appellate court agreed with prosecutors’ assessment that the case met the legal standards for the waiver to Superior Court. “As with all cases, we are assessing our next steps, which will include discussions with the victim and her family,” he said in a statement.

Speaking with the Times, Gramiccioni said, “This is conduct that should be punished in adult court. We subscribe to the idea that the juvenile system is supposed to be rehabilitative. But when you’re dealing with charges as serious as these, it’s a whole different ball of wax.”

Write to Mahita Gajanan at mahita.gajanan@time.com.