Spain's Supreme Court has found five men who called themselves "The Pack" guilty of gang rape, refuting previous convictions of the lesser offence of sexual abuse in a case that shook the country.

The Madrid-based tribunal sentenced each defendant to 15 years in prison, overturning two previous rulings in the case that sparked mass protests in Spain.

"The factual account describes a genuine scenario of intimidation in which the victim never consents to the sexual acts performed by the accused," the court ruled.

The victim found herself in "a situation of intimidation that made her adopt an attitude of submission, doing what the perpetrators told her to do."

The five men raped the woman, then aged 18, at the entrance to an apartment building in Pamplona in July 2016 at the start of the popular San Fermin bull-running festival.

Minutes after meeting her, they had unprotected sexual relations with her that included oral sex and left her half-naked in the doorway. One of them also stole her mobile.

The five men filmed the incident with their smartphones and then bragged about it on WhatsApp where they referred to themselves as "La Manada," or "The Pack".

The footage they shared on WhatsApp was used against them in court but also against the victim for her passivity during the act.

In April 2018, the men were each sentenced to nine years in jail for sexual abuse but judges acquitted them of the more serious offence of rape.

It was decided there had been no violence or intimidation - necessary to for a rape conviction in Spain - and that the victim did not resist or fight back.

One of the three judges had argued that the men should be fully acquitted.

That decision - and the subsequent release on bail of the defendants - sparked nationwide protests.

Following the earlier verdict, the Spanish government announced plans to reform the criminal code to stipulate that a woman must give her explicit consent for sex.

The move would be based on a tough new Swedish law that states a person can be accused of committing rape if the other person has not given explicit consent, even if there is no violence or threats.

The five defendants, all from the southern city of Seville, were not called to the stand on Friday and the victim has never wanted to appear in public.

"The victim was surrounded by the defendants, she was affected and felt incapable of reacting," Prosecutor Isabel Rodriguez argued, calling for an 18-year jail sentence for each defendant, with an extra two for the one who stole the mobile.

The court sentenced the latter to those extra two years.

Defence lawyer Agustin Martinez argued the sex was consensual and called for his clients to be absolved.

He said they could not have realised she was not consenting as she did not shout or resist.

She did not make "any kind of gesture of protest."

"We haven't had a fair trial," he added, denouncing media, social and political "pressure".

The April 2018 sentence had already been upheld on appeal at the high court of the northern Navarra region where Pamplona is located.

It said there had been no proof of violence, and that it was too difficult to discern whether intimidation had taken place given the lack of obvious show of force or threats towards the victim.

But two out of five of the male judges had disagreed, saying it was rape.