Alves, 39, is accused of sexually assaulting a woman in a nightclub in Barcelona in December.
In a video statement later on Friday, Liga MX club Pumas UNAM president Leopoldo Silva announced that they were terminating Alves' contract.
"Club Universidad makes the decision to terminate the contract with Dani Alves with just cause," Silva said.
"This is an institution that promotes respect and the correct, dignified and professional behavior of its male and female players both on and off the field because they are role models in Mexico and throughout the world. We cannot permit any conduct that would damage our philosophy.''
Alves returned to Spain from Mexico this week to face the charges. He presented himself at a local police station in Barcelona on Friday and was then taken to the Ciutat de la Justicia by officers pending examination by the judge.
State prosecutors had asked for him to be held without bail, and a judge agreed after charging him with sexual assault following several hours of testimony from him, the alleged victim and a witness, the court said.
Unless that decision is reversed on appeal, Alves will remain in custody until trial at a still-unspecified date. The initial investigation was launched earlier this month. Alves has denied any wrongdoing.
A charge of sexual assault in Spain can mean anything from unsolicited and unwanted sexual groping to rape. Police said they could not give any details on the case, but the alleged victim testified on Friday that Alves groped her and raped her on Dec. 30 at Sutton, a nightclub in Barcelona.
A woman first filed a police report against Alves on Jan. 2, alleging that he touched her inappropriately under her clothes without consent.
According to La Vanguardia newspaper, the 23-year-old notified the nightclub managers and they contacted the police. The police then transferred the alleged victim to Barcelona's Hospital Clinic, a referral hospital for treating sexual abuse cases. Two days after the alleged rape, the young woman reported the former player to the authorities.
The woman said she told security what had happened and local police were informed and took witness statements.
"I would like to deny everything, first," Alves said. "I was there, in that location, with more people, having a good time. Everybody knows that I love to dance. Having a good time, but without invading the space of others.
"I'm very sorry, but I don't know who that young lady is, I don't know who she is, I've never seen her in my life."
Alves, a defender, was a key part of Barcelona's golden years, playing on the team's right flank with Lionel Messi between 2008 and 2016. He won the Champions League three times with the Catalan club, which he briefly rejoined last season.
The 39-year-old player is one of soccer's most successful players, winning major titles with several clubs. He also helped Brazil win two Copa America trophies -- in 2007 and 2019 -- and an Olympic gold medal at age 38.
Information from The Associated Press and EFE news agency was used in this report.