Mir, 27, was arrested by the police on Monday following a complaint filed against him by a woman. He appeared before a judge on Wednesday to testify.
The judge who ordered his conditional release will now lead an investigation to establish whether there is enough evidence for Mir to stand trial or if the case should be dropped.
"Rafa Mir categorically denies the accusations against him... The criminal proceedings will clarify the events and will show that the accusation does not stand up," Mir's lawyer Jaime Campaner said in a statement.
The court said it was investigating Mir for an alleged crime of sexual assault involving intercourse. He will have to appear in court regularly and is not allowed to leave the country throughout the investigation.
Mir has also played for Wolverhampton Wanderers and Sevilla, who have loaned him to his boyhood club Valencia.
The player has been given Thursday and Friday off, and could return to training on Monday, a Valencia source said.
Last year, another LaLiga club, Celta Vigo, unilaterally ended the contract of player Santi Mina after a court handed him a four-year prison sentence for sexually abusing a woman in 2017. He had kept playing for Valencia and Celta until he was convicted in 2022.
In another high-profile case, Brazilian soccer player Dani Alves was released from a Spanish prison in March after he served about a quarter of his four-and-a-half-year sentence for the rape of a woman in a nightclub's restroom in 2022.