The former Brazilian international footballer was convicted in February and sentenced to 4.5 years in prison.

A Spanish court has decided to release ex-Brazil and Barcelona footballer Dani Alves if he pays a bail of 1 million euros ($1.1 million) and hands over his passports while awaiting the appeal of his conviction for raping a woman in Barcelona.

The court issued the ruling on Wednesday.

Alves, 40, was convicted in February and sentenced to four years and six months in prison for having raped a woman in a nightclub in 2022.

He has been behind bars since his arrest in January 2023. His prior requests to be let free on bail were denied because the court deemed him a flight risk.

To now go free, in addition to the bail money, Alves is also required to hand over his Brazilian and Spanish passports and not leave the country.

Both his defence lawyer and the state prosecutor have appealed the conviction. His defence is seeking his acquittal while the prosecutor wants his prison sentence increased to nine years. There is no date yet for the new trial at a higher court in Barcelona. It can then go to the Supreme Court in Madrid.

Alves played for Brazil from 2006 to 2022 and is the nation’s third most-capped player with 126 international appearances. He played 247 games for Spanish club Barcelona from 2008 to 2016.