MADRID — A Spanish court on Tuesday heard final arguments from lawyers and defendants in a gang rape trial that has gripped Spain and triggered criticism over how cases involving alleged abuse of women are handled.

The case known as “La Manada” or “‘animal pack,” after the nickname the five defendants gave themselves, centers around a woman’s allegation that she was gang raped by them during Pamplona’s San Fermin festival in July 2016.

The five say the young woman consented. The prosecutor denies that and says violence was used.

The case brought widespread criticism from women’s groups after the court agreed to study a defense detective’s report on the woman’s behavior after the incident, which some said made it appear the victim was on trial. There was also a flurry of debate in the media over whether the woman was telling the truth.

Women protested angrily for several days outside the Pamplona court house. On Nov. 17, demonstrations in support of the woman, who has not been identified, were held in several Spanish cities. The case also gave rise to a social media campaign titled “I believe You” in which women supported the alleged victim and criticized the handling of cases of sexual aggression.

The incident sparked a furor in 2016 when it was found that the five, all in their late 20s, had videoed the sex acts and sent phone messages to friends promising to post the videos.

Private news agency Europa Press quoted lawyer Agustin Martinez Becerra, who represents some of the defendants, as saying Tuesday that the late-night sex acts in a building entrance were “with consent, there was no sexual aggression.”

He said that the videos showed a sexual act — “It’s a porn film,” he said — but he denied they showed aggression.

The defense argued that at no time did the woman protest or shout. He said the five, all from southern Seville, “may be genuine imbeciles,” but were also “good sons.”

But prosecutor Elena Sarasate said that “sexual aggression had been fully proven,” pointing out that the gang had stolen the woman’s mobile phone, allegedly to prevent her from calling police immediately.

The detective report that triggered so much criticism was later withdrawn by the defense.

Spanish newspaper El Mundo said in an editorial Tuesday it was “a vile case that demanded level-headedness.”

The daily defended the court’s handling of the case, adding that “the social alarm and the revulsion over what happened must not allow noise to rule over reason.”

El Mundo said the media was not without blame and added that some of the “emotionally loaded” demonstrations had influenced public opinion and did little to help justice be done.

The judge hearing the case for the past two weeks will issue a verdict in the coming weeks.

The prosecutor is asking for sentences of 22 years.