A federal appeals court has ruled that an illegal immigrant and convicted felon can’t be deported back to Mexico because he identifies as a transgender woman, which leaves him vulnerable to torture back in his home country.

Edin Carey Avendano-Hernandez was born male in Mexico, and claims to have been raped by his brothers and suffered other torments. In 2000, he illegally entered the U.S. and took up residence in Fresno, California. Avendano-Hernandez also started taking female hormones and began living openly as a woman in 2005. In 2006, he committed two separate drunk driving offenses, the second of which injured two people and resulted in a felony conviction. After serving a year in jail, he was deported back to Mexico in 2007.

Back in Mexico, Avendano-Hernandez claims to have been subjected to more harassment from family and neighbors and to have been raped by members of the Mexican army. He illegally entered the U.S. again and, after being arrested, petitioned for sanctuary in the U.S. under the U.N. Convention Against Torture (CAT), arguing that deporting him would violate the CAT because he would more likely than not experience torture at the hands of Mexican authorities.

An immigration judge and the Board of Immigration Appeals (BIA) both rejected Avendano-Hernandez’s arguments on the grounds that he had committed a serious crime (felony drunk driving) and was not likely to face official torture.

Now, a three-judge panel on the Ninth Circuit Court of Appeals says Avendano-Hernandez must be allowed to stay in the U.S., because he “more likely than not” will be tortured if returned to Mexico.

Judge Jacqueline Nguyen, an Obama appointee, chastised immigration officials for improperly handling Avandano-Hernandez’s gender identity.

“The [judge] failed to recognize the difference between gender identity and sexual orientation, refusing to allow the use of female pronouns because she considered Avendano-Hernandez to be ‘still male,’ even though Avendano-Hernandez dresses as a woman, takes female hormones, and has identified as woman for over a decade,” Nguyen’s decision says. “Although the BIA correctly used female pronouns for Avendano-Hernandez, it wrongly adopted the [judge’s] analysis, which conflated transgender identity and sexual orientation. The BIA also erred in assuming that recent anti-discrimination laws in Mexico have made life safer for transgender individuals while ignoring significant record evidence of violence targeting them.”

Nguyen cites the repeated sexual abuse Avendano-Hernandez claims to have endured as evidence of de facto torture, and furthermore concludes that these actions were not crimes committed by individuals but were instead endorsed by the Mexican government.

“Avendano-Hernandez provided credible testimony that she was severely assaulted by Mexican officials on two separate occasions: first, by uniformed, on-duty police officers … and second, by uniformed, on-duty members of the military. Such police and military officers are “public officials” for the purposes of CAT,” Nguyen wrote. She added that this torture was likely to resume should Avendano-Hernandez ever return to Mexico.

The belief that Avendano-Hernandez was raped and tortured in Mexico appears to be based entirely on his own claims, which were deemed to be “credible” by his immigration judge.

Nguyen said it did not matter that in recent years Mexico has passed laws intended to protect its gay community, arguing that those laws don’t extend far enough to protect the transgendered.

“[L]aws recognizing same-sex marriage may do little to protect a transgender woman like Avendano-Hernandez from discrimination, police harassment, and violent attacks in daily life,” she said. She added that Mexican police sometimes target the transgendered for extortion and sexual favors, and said the country has an alarming number of unsolved murders of the transgendered.

The decision technically doesn’t spare Avendano-Hernandez from deportation, but it means his deportation will be delayed until he no longer faces a risk of being tortured.

While the decision only applies to Avendano-Hernandez, it could encourage more transgendered Mexicans to seek asylum in the U.S., as Nguyen’s description of torture in Mexico is quite general.

Follow Blake on Twitter

Send tips to blake@dailycallernewsfoundation.org.

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@ dailycallernewsfoundation.org.

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.