The latest trial has renewed a bitter public debate, and the police had to intervene to prevent a relative of the young victim from assaulting one of the defendants outside the courtroom.

Public prosecutors initially recommended that the men be found guilty of sexual abuse rather than rape because the teenage victim had been drunk, had possibly taken drugs and, they said, did not oppose the attack. But they later toughened the charges after hearing testimony from the victim.

The victim told the court that although she could not recall every detail of the assault, she had flashbacks about the attack. She also said that she felt intimidated and fearful because the men appeared to have a gun. (It turned out to be a fake.)

The assault took place in an abandoned building during an outdoor party in Manresa in October 2016. The men said they had seen the victim at the party, and one persuaded her to accompany him into the building. The men said that they had drunk alcohol and smoked marijuana at the party. The court found that they then took turns assaulting the victim, after bringing her to the building.

The men told the court that they believed the girl was 16 at the time, which is the legal age of consent in Spain, but the judges rejected this argument. The men also denied forcing the girl to have sex.

The court ruled that the girl had found herself in “a situation of helplessness,” and ordered the men to pay the victim 12,000 euros in compensation, about $13,367, for an assault that was described as “extremely intense and especially degrading.”

Women’s associations in Spain have been pushing the judiciary to treat all forms of rape more forcefully. They have also accused Spanish judges of paternalism and bias against women by forcing victims to demonstrate that they had fought back against sex attackers.