A court in Barcelona cleared five men of sexual assault charges on Thursday after saying the crime did not fit the legal definition of rape because the unconscious teenage victim didn't fight back.

Under Spanish law, a sexual attack can only be classified as an assault or rape if the perpetrator uses violence or intimidation. Because the 14-year-old victim was unconscious, the five were convicted of a lesser charge of sexual abuse.

The Barcelona court sentenced the five men to 10 to 12 years in prison, despite the prosecution arguing they should be charged with assault.

The attack happened at a party in Manresa, a town northwest of Barcelona, in 2016. The court heard that the group was partying in an abandoned factory, when the victim consumed "alcohol and drugs" and became unconscious.

The men then took turns to perform sexual acts on the teenager, according to a statement published on the court's website.

The court said the victim was "in a state of unconsciousness ... without being able to determine and accept or oppose the sexual relations maintained with defendants, who could perform sexual acts without using any type of violence or intimidation."

The court said the attack had to be classified as sexual abuse because "it has been proven that the victim, while the events took place ... was in a state of unconsciousness," according to a statement published on its website.

The court also awarded the victim 12,000 euros (US$13,400) in damages. Two more men attending the party were acquitted of all crimes, the court said.

The hearing sparked protests across Spain reminiscent of the response to a similar case in which five men, dubbed "the Wolf Pack," were originally acquitted of rape and convicted of abuse. Spain's Supreme Court overturned the decision in June, after a year of demonstrations, sentencing the men to 15 years in prison for rape.