LOS ANGELES – The Los Angeles school district was wrong to blame a 14-year-old girl for the sexual abuse she suffered at the hands of her eighth-grade math teacher, an appellate court ruled Wednesday.

The state Court of Appeal overturned a lower court’s ruling involving Edison Middle School teacher Elkis Hermida, 28, who was convicted in 2011 of lewd acts with a minor and sentenced to three years in prison, the Associated Press reports.

During a 2013 civil trial, the student victim claimed the district was liable for emotional damage that resulted from repeated sexual encounters with her teacher over seven months in 2010 and 2011 for failing to supervise Hermida. Attorneys for the school district argued the 14-year-old was partially responsible for the abuse, and convinced the court to allow the girl’s sexual history as evidence, according to the Los Angeles Times.

MORE NEWS: Know These Before Moving From Cyprus To The UK

“On appeal, the District continues to maintain that a minor student who is the victim of sexual abuse by a teacher bears responsibility for preventing that abuse. The District was wrong in the trial court and is wrong now,” Judge Richard H. Kirschner wrote in Wednesday’s ruling. “There is no case or statutory authority or persuasive reasoning supporting the notion that students sexually victimized by their teachers can be contributorily responsible for the harm they suffer.”

The ruling states the judge in the civil trial also shouldn’t have told the jury to decide whether the teacher had a “propensity” to abuse the girl. Rather, the question should have hinged on the teacher’s “potential” to abuse, KPCC reports.

“Indeed, no first victim of a predatory teacher would have a remedy, since he or she could not prove propensity,” the ruling reads. “This is not the law.”

The appeals court also took issue with the trial court judge’s decision to allow the victim’s sexual history to be introduced in the trial.

“The jury asked a significant number of questions about plaintiff’s sexual history which indicated an improper and irrelevant interest in the topic,” the ruling read. “The District then exacerbated the prejudice by using plaintiff’s relationships with boys to argue that she was sophisticated and could, in effect, voluntarily consent to sex with Hermida.”

The case sparked outrage last year when one of the attorneys for the school district, W. Keith Wyatt, claimed that a 14-year-old was more at risk by crossing the street than consenting to sex with her teacher.

MORE NEWS: How to prepare for face-to-face classes

Wyatt told KPCC last November that “making a decision as to whether or not to cross the street when traffic is coming, that takes a level of maturity and that’s a much more dangerous decision than to decide, ‘Hey, I want to have sex with my teacher.'”

“The girl’s appellate attorney, Holly Boyer of Pasadena, had argued that district assertions that the student bore some blame ignored the ‘grooming’ process that sexual abusers often undertake to disarm young victims,” the Times reports.

“Hermida first reached out to the girl on social media when she was 13, then moved to texting about ‘secrets’ such as sex. He then began inviting her to his classroom, where they kissed and eventually had sex on campus and at nearby motels, according to court papers.”

Boyer told KPCC the girl’s family is “happy and pleased with the Court of Appeal’s opinion and grateful that they’ve stepped in and put an end to the district’s position.”

Wyatt was fired from representing the school district shortly after his distasteful comments to KPCC, though the firm he works for – McNeill & Wyatt – still represents the school district in more than a dozen lawsuits.

The case also sparked legislation prohibiting those accused of sexually abusing minors in civil suits from using the blame the victim defense that was signed into law by Gov. Jerry Brown in July, the Times reports.