HELENA, Mont. — A Mexican man who says he was raped in 2013 while detained by U.S. immigration officials will likely be in their custody again for at least three months while a court decides whether he should be deported.

The 9th U.S. Circuit Court of Appeals blocked the immediate deportation of 44-year-old Audemio Orozco-Ramirez, after he was arrested in Billings, Montana, on Wednesday by U.S. Immigration and Customs Enforcement officials.

The court told U.S. government lawyers to file a written argument by Oct. 25. In the meantime, Orozco-Ramirez is being held in a facility in Utah, and his attorney is asking for his release.

“Considering that he was raped the last time he was in ICE custody, it is hard to fathom why ICE would insist on keeping him in detention,” said attorney Shahid Haque.

ICE officials did not respond to an email requesting comment.

Orozco-Ramirez, who has lived in the U.S. illegally for more than 20 years, was originally detained in 2013 when the car he was riding in as a passenger was stopped for speeding in northeastern Montana. ICE officials briefly detained him in Montana’s Jefferson County jail while they began deportation proceedings against him.

Orozco-Ramirez said other inmates in his cell held him down and raped him. County and federal officials disputed that the rape had happened, but ICE dropped the deportation order, allowed him to have a work permit and required that he check in with immigration officials every month.

Orozco-Ramirez sued the county in 2015, saying officials there should have protected him. They reached a settlement in December in which Orozco-Ramirez received $125,000 and the county didn’t admit the rape occurred.

The Associated Press typically does not name rape victims, but Orozco-Ramirez has talked publicly about his case.

Orozco-Ramirez was arrested Wednesday during one of his check-ins with ICE officials in Billings. They planned to deport him within days before Haque filed the emergency petition with the 9th Circuit.

“We are asking ICE to release him from custody so he can return to his family while this process is sorted out,” Haque said. “He has seven children to take care of, he isn’t going anywhere.”