PHOTO: Ulrich Baumgarten/Ulrich Baumgarten/U. Baumgarten via Getty Images
Now playing
04:26
Judge rebuked by appellate court in sexual assault case
PHOTO: CNN
Now playing
03:44
Acting US Capitol Police chief explains 'operational challenges' from January 6 riot
Rep. Marie Newman (D-IL) speaks with CNN
PHOTO: CNN
Rep. Marie Newman (D-IL) speaks with CNN's Alisyn Camerota.
Now playing
07:17
Lawmaker reacts to Rep. Taylor Greene's tweet on her transgender daughter
An activist wears a "Fight For $15" T-shirt during a news conference prior to a vote on the Raise the Wage Act July 18, 2019 at the U.S. Capitol in Washington, DC. The legislation would raise the federal minimum wage from $7.25 to $15 by 2025.  (Photo by Alex Wong/Getty Images)
PHOTO: Alex Wong/Getty Images
An activist wears a "Fight For $15" T-shirt during a news conference prior to a vote on the Raise the Wage Act July 18, 2019 at the U.S. Capitol in Washington, DC. The legislation would raise the federal minimum wage from $7.25 to $15 by 2025. (Photo by Alex Wong/Getty Images)
Now playing
02:59
How to make sense of the minimum wage debate
AURORA, CO - DECEMBER 15: (EDITORIAL USE ONLY) Rocky Mountain Regional VA Medical Center investigational pharmacy technician Sara Berech prepares a dose of the Johnson & Johnson COVID-19 vaccine for a clinical trial on December 15, 2020 in Aurora, Colorado. The Johnson & Johnson vaccine could be submitted for emergency use by late January and is the only vaccine among leading candidates given as a single dose. (Photo by Michael Ciaglo/Getty Images)
PHOTO: Michael Ciaglo/Getty Images
AURORA, CO - DECEMBER 15: (EDITORIAL USE ONLY) Rocky Mountain Regional VA Medical Center investigational pharmacy technician Sara Berech prepares a dose of the Johnson & Johnson COVID-19 vaccine for a clinical trial on December 15, 2020 in Aurora, Colorado. The Johnson & Johnson vaccine could be submitted for emergency use by late January and is the only vaccine among leading candidates given as a single dose. (Photo by Michael Ciaglo/Getty Images)
Now playing
02:46
FDA says Johnson & Johnson vaccine is safe and effective
AUGUSTA, GEORGIA - NOVEMBER 15: Tiger Woods of the United States looks on from the third tee during the final round of the Masters at Augusta National Golf Club on November 15, 2020 in Augusta, Georgia. (Photo by Patrick Smith/Getty Images)
PHOTO: Patrick Smith/Getty Images
AUGUSTA, GEORGIA - NOVEMBER 15: Tiger Woods of the United States looks on from the third tee during the final round of the Masters at Augusta National Golf Club on November 15, 2020 in Augusta, Georgia. (Photo by Patrick Smith/Getty Images)
Now playing
02:43
Tiger Woods' team gives an update on his condition
Connolly
PHOTO: CNN
Connolly
Now playing
03:51
'I will not be lectured' on bipartisanship: Lawmaker fires back at Jim Jordan
PHOTO: KCAL/KCBS
Now playing
01:37
Official details speaking with Woods in moments following accident
PHOTO: CNN
Now playing
04:15
Experts: Former CIA agent victim of microwave weapon in Moscow
Trump supporters clash with police and security forces as people try to storm the US Capitol on January 6, 2021 in Washington, DC. Demonstrators breeched security and entered the Capitol as Congress debated the 2020 presidential election Electoral Vote Certification.
PHOTO: Brent Stirton/Getty Images
Trump supporters clash with police and security forces as people try to storm the US Capitol on January 6, 2021 in Washington, DC. Demonstrators breeched security and entered the Capitol as Congress debated the 2020 presidential election Electoral Vote Certification.
Now playing
04:34
This is what we learned from Capitol riot hearing
Now playing
02:08
Cabinet secretary explains why he took on challenging role
Angelo Quinto
PHOTO: Law Offices of John Burris
Angelo Quinto
Now playing
02:00
Man dies after police kneel on his neck, family says
PHOTO: AFP/Getty Images
Now playing
04:54
Ocasio-Cortez rips Democrat's doubts about Biden nominee
Then-President Donald Trump addresses supporters during a Make America Great Again rally in Erie, Pennsylvania, October 20, 2020.
PHOTO: SAUL LOEB/AFP/Getty Images
Then-President Donald Trump addresses supporters during a Make America Great Again rally in Erie, Pennsylvania, October 20, 2020.
Now playing
02:44
What Trump's released tax records mean for DA's criminal case
From left, President Joe Biden, First Lady Jill Biden, Vice President Kamala Harris and her husband Doug Emhoff, bow their heads during a ceremony to honor the 500,000 Americans that died from COVID-19, at the White House, Monday, Feb. 22, 2021, in Washington. (AP Photo/Evan Vucci)
PHOTO: Evan Vucci/AP
From left, President Joe Biden, First Lady Jill Biden, Vice President Kamala Harris and her husband Doug Emhoff, bow their heads during a ceremony to honor the 500,000 Americans that died from COVID-19, at the White House, Monday, Feb. 22, 2021, in Washington. (AP Photo/Evan Vucci)
Now playing
05:45
Biden leads nation in mourning 500,000 US Covid-19 deaths
PHOTO: NASA
Now playing
01:15
Watch the Perseverance rover's first footage of Mars
donald trump juicio politico violencia capitolio presidente eeuu gobierno senado aristegui mexico roberto izurieta republicanos democratas_00002909.png
donald trump juicio politico violencia capitolio presidente eeuu gobierno senado aristegui mexico roberto izurieta republicanos democratas_00002909.png
Now playing
02:48
Supreme Court allows release of Trump tax returns
(CNN) —  

In 2017, a 16-year-old boy in New Jersey was accused of raping an intoxicated 16-year-old girl in the dark basement of a house party. According to court documents, the boy filmed the encounter, the girl’s bare torso exposed and her head repeatedly banging against a wall. He allegedly shared the video with friends, and it continued to circulate for months despite the girl’s pleas for him to stop its dissemination.

At one point, according to documents, he texted friends: “[w]hen your first time having sex was rape.”

Prosecutors called his actions “sophisticated and predatory” and pushed for him to be waived from the juvenile court system and tried as an adult. However, in July 2018, a family court judge denied the request, and his reasons are now drawing serious reproach from an appeals court.

Boy was headed for a ‘good college,’ judge says

In his denial, Judge James Troiano of Monmouth County Superior Court said the boy’s actions were not predatory and not necessarily rape because “traditional” rape cases involve “two or more generally males involved, either at gunpoint or weapon, clearly manhandling a person.”

He said the boy shouldn’t be tried as an adult because he “comes from a good family who put him into an excellent school,” because he was an Eagle Scout, because he was probably headed for a “good college” and because his “scores for college entry were very high.”

Troiano said the girl and her family should have been told that bringing charges against the boy could have a “devastating effect” on his life.

A court hands back the case

On June 14, the Appellate Division of the New Jersey Superior Court reversed Troiano’s decision and sent the case back down for further judgment.

The appeal claimed that Troiano “erred in denying the waiver motion because, in the process, he substituted his judgment for that of the prosecutor.”

The appeals court judges agreed, and their decision specifically cited Troiano’s mention of the boy’s background.

“That the juvenile came from a good family and had good test scores we assume would not condemn the juveniles who do not come from good families and do not have good test scores from withstanding waiver applications.”

A decision hangs in the balance

Now that the case is back in Monmouth County courts, prosecutors are planning their next move and could seek to indict the defendant in criminal court.

“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,” Monmouth 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.”

New Jersey Courts Director of Communications Peter McAleer said Troiano has no comment on the most recent developments.

The defendant’s attorney has not responded to a request for comment.

A closer look at the case

A lot of information about the case, including the defendant’s name, is sealed because he is a minor. However, court documents reveal additional details about the incident: The girl, referred to in documents as “Mary,” which is not her real name, was visibly drunk at the party before the encounter. At some point, she and the defendant entered a darkened part of the house’s basement.

The appeal decision describes what happened next:

“While on the sofa, a group of boys sprayed Febreze on Mary’s bottom and slapped it with such force that the following day she had hand marks on her buttocks.”

Mary, who according to court documents had slurred speech and stumbled as she walked, entered a darkened part of the house’s basement with the defendant where the alleged assault took place.

Afterward, the defendant left, and his friends found Mary on the floor, vomiting. She was eventually driven home by a friend’s mother.

“The following morning, Mary discussed with her mother her fear that sexual things had happened at the party. She did not understand how she could have gotten bruise marks on her body or how her clothing had torn,” the decision reads.

Mary and her family decided to press charges several months later, after Mary learned that the defendant was sharing video of the incident among their social circles despite telling her that there was no video.

CNN’s Taylor Romine contributed to this report.