The San Francisco Public Defender’s Office slammed the U.S. Immigration and Customs Enforcement Agency Friday for conducting what it claims was an illegal transfer of one of its clients, a female transgender inmate, from California to Texas on Christmas night.

The office has represented Lexis Avilez in her immigration case since last January. She’s been in ICE custody since 2018 and detained in the Yuba County Detention Center. San Francisco public defenders sometimes take on immigration clients from outside the city when their cases move through the federal San Francisco Immigration Court.

On Christmas night, according to the Public Defender’s Office, the Yuba County Sheriff’s Office approached Avilez in her cell and led her to believe she was being released. Instead, she was transferred into ICE custody and flown some 2,000 miles to the Prairieland Detention Center in Alvarado, Texas.

Avilez’s public defender, Hector Vega, said in an interview that she’s been “held in deplorable conditions” since her arrival at Prairieland, where guards have kept her in segregated confinement, forced her to wear men’s clothes and denied her free calls to her attorneys.

“The conditions of my detention have worsened and have had a huge impact on my mental health and my ability to move forward. I think this has been so cruel to me,” Avilez said in a statement.

On Friday, Vega filed court documents requesting an immediate hearing on Avilez’s behalf to request that she be transferred back to Yuba County, where she can be closer to her lawyer and to her family as her immigration case progresses.

The reason for the transfer remains unclear to the Public Defender’s Office. About a week before the move, Vega filed court documents asking for Avilez’s release or for a bond hearing.

Vega characterized the transfer as “a callous act from a heartless agency, and we demand that ICE release Lexis from custody.”

Representatives from ICE and the Yuba County Sherrif’s Office didn’t respond to requests for comment.

While in custody in Yuba County, Avilez previously attempted suicide after spending a month in solitary confinement, Vega said.

“My worry is that the same thing will happen again, that the depression and (post-traumatic stress) in isolated confinement will yet again lead to suicidal thoughts,” Vega said, adding that Avilez’s medical file was not sent along with her to the Texas facility — he had to send it along himself.

Avilez came to the U.S. as a baby from Mexico in 1979, according to the Public Defender’s Office. She became a legal resident when she was 18 years old. But ICE sought to deport her after she was convicted of felony assault in Salinas.

She is seeking to avoid deportation on what she believes is the “strong likelihood” that she would be tortured based on her identity as a transgender woman, Vega said.

Dominic Fracassa is a San Francisco Chronicle staff writer. Email: dfracassa@sfchronicle.com Twitter: @dominicfracassa