Alves had maintained the sex was consensual. The prosecutor was seeking a nine-year prison term.
The court also imposed a restraining order barring Alves from coming within 1,000 metres (3,300 feet) of the victim.
The three-judge panel denied a request by Alves's lawyer Ines Guardiola for the trial to be suspended on the basis that he was not given enough time to prepare for his first police interview after his arrest and had suffered a parallel trial by media.
Dani Alves, who has denied any wrongdoing, was taken to the Brians 1 jail outside Barcelona.
Alves had previously denied any sexual encounter with the woman who filed a complaint in January about an alleged sexual assault in a restroom at an exclusive Barcelona nightclub.
"Neymar and Messi are unique: they see and do things nobody else sees or can do. A great player must know and understand who he plays with, your teammates enrich your qualities."
News of all that's transpired on and off the football field