Spain's Supreme Court has ruled that an attack on a teenage woman that shocked Spain was gang rape, rather than an earlier verdict of sexual abuse.
The five men, known as the "wolf pack", were originally given nine years in jail when they were cleared of rape.
But prosecutors appealed to the Supreme Court to upgrade the conviction and judges increased their sentences to 15 years.
The attack prompted Spain to announce a review of its rape laws.
All five had been on provisional release since last year pending the Supreme Court decision. Prosecutors had asked for their jail terms to be doubled to 18 years.
Reports say that at least two of the men were detained after the verdict and arrest warrants have been issued for the rest.
The court ruled decisively that the five had carried out the attack in "a genuinely intimidating scenario". Under current Spanish rape law use of intimidation is key to a rape conviction.
What did they do?
In July 2016, when the city of Pamplona was holding its traditional San Fermin bull-running festival, the 18-year-old woman was dragged into the hallway of a residential building. The five men removed her clothes and had unprotected sex with her.
Some of them filmed it on their phones. The woman's phone was also stolen and she was found reportedly in a distraught state.
They sent the video around their WhatsApp chat group, called "La manada" (the wolf pack), and the video has since become central to the question of whether they raped the woman or sexually abused her.
A police report said she had kept her eyes closed at all times, showing a "passive or neutral" expression throughout.
What was the original verdict?
In April 2018, a court in Navarra jailed the men for nine years each for sexual abuse but acquitted them of the graver charge of sexual assault, the equivalent of rape under existing Spanish law.
The ruling was based on a decision that the woman had not faced violence or intimidation, but had been abused. Two months later, the same regional court ordered the men's provisional release pending appeal as they were not deemed a flight risk.
The verdict prompted widespread demonstrations from rights groups and politicians who were incredulous that a prolonged sexual assault involving intercourse by five men could be anything other than rape.
Read more on the sex attack that changed Spain
But the Supreme Court of Navarra upheld that conviction, agreeing there had been no sexual assault.
They decided the woman had not given consent to sex and that the men had used their undue position of superiority to carry out sexual abuse.
Two of the five judges decided the men had used intimidation to carry out a "continuous offence of sexual assault", but they were outvoted.
What has the Supreme Court now decided?
The court ruled that the original verdict was wrong as the victim had not consented to sex and it was carried out in a "genuinely intimidating scenario". The circumstances, it found, had been aggravated by the joint action of two or more people.
The victim, the court found, had adopted a submissive approach faced with the distress and intense stress of being forced into a narrow and hidden place with no means of escape.
José Ángel Prenda, Jesús Escudero, Alfonso Jesús Cabezuelo, Antonio Manuel Guerrero and Ángel Boza were each given 15 years. As well as a 15-year jail term, Guerrero was given another two years for stealing the victim's mobile phone.
They were told not to approach within 500m (546yds) of the victim for the next 20 years, increasing to €100,000 (£89,000; $113,000) the amount of compensation.
Prosecutors had asked the court to upgrade the conviction to sexual assault, arguing that the "proven facts constitute a continuous crime of rape" because "sufficient intimidating force" was used against the victim.
"You cannot demand a dangerously heroic stand from victims," prosecutor Isabel Rodríguez was quoted as saying.
Defence lawyers had sought the acquittal of the men and argued on Friday there was no intimidation of any sort and that the woman had only complained of assault when she found out her mobile phone had been taken.
The politically charged case has already prompted Spanish Prime Minister Pedro Sánchez to push for a reform of Spain's rape laws based on a woman giving explicit consent to sex.