A court in Spain has found former Barcelona and Brazil footballer Dani Alves guilty of raping a woman in a Barcelona nightclub.

He has been sentenced to four and a half years in prison.

The 40-year-old, who is one of the most decorated footballers in history, had denied sexually assaulting the woman in the early hours of 31 December 2022.

His lawyer had asked for his acquittal and Alves can appeal against the sentence.

As well as handing Alves a four-and-a-half year sentence, the court ordered him to pay €150,000 (£128,500) to the victim and said he should face five years’ probation afterwards.

Prosecutors said Alves and his friend had bought champagne for three young women before luring one of them to a VIP area of the nightclub with a toilet which she had no knowledge of.

They argued that it was at this point he turned violent, forcing the woman to have sex despite her repeated requests to leave.

Alves had maintained she could have left “if she wanted to”. However, the court found that she did not consent.

In a statement, the court said there was evidence other than the victim’s testimony that proved that she had been raped.

It said Alves had “abruptly grabbed the complainant” and thrown her to the ground. He had then raped her while preventing her from moving as “the complainant said no and wanted to leave”, it added.

The woman said the rape had caused her “anguish and terror”, and one of her friends who was with her on the night described how the 23-year-old had cried “uncontrollably” after leaving the bathroom.

Alves has been held in pre-trial detention since January 2023 and has changed his testimony on a number of occasions.

He first denied knowing his accuser only to claim later that he had met her in the toilet but that nothing had happened between them.

He then changed his version of events again, saying that they had had consensual sex. “We were both enjoying ourselves,” he alleged.

The prosecution had asked for a nine-year prison sentence. In Spain, a claim of rape is investigated under the general accusation of sexual assault, and convictions can lead to prison sentences of four to 15 years.

The law was changed recently to enshrine the importance of consent under the so-called “Only Yes is Yes” principle.

Alves played more than 400 times for Barcelona, winning six league titles and three Champions Leagues across two spells with the club. He was also part of Brazil’s 2022 World Cup squad.