A California inmate was sentenced to death Thursday for the 2013 killing of his transgender cellmate in a shocking case that shined a light on the dangers of sexual assault and violence trans people face when they are not housed according to their gender identity.

Miguel Crespo, 48, was housed with Carmen Guerrero, a trans woman, at Kern Valley State Prison for just eight hours in October 2013. During that time, Crespo bound, gagged, tortured and murdered Guerrero in their shared cell.

A California jury last month found Crespo guilty of first degree murder and assault.

Miguel Crespo. Kern County DA's office / via KGET

At his sentencing, Crespo made it a point to tell officials that he’s not gay and that he had told officers in 2013 that he was incompatible with Guerrero before the prison housed them together anyway.

“I had a restriction not to be housed with a [gay expletive],” Crespo said, according to NBC affiliate KGET.

Crespo was originally incarcerated for a 1993 murder in Los Angeles County. Guerrero was serving a life sentence for second degree murder.

The issue of transgender people in California’s prison system is fraught and even became a topic in the Democratic presidential primaries, with former candidate Sen. Kamala Harris facing questions over her stance on granting state-funded, gender-reassignment surgeries to transgender inmates.

In May, the California Senate passed a bill that would require transgender prisoners to be housed according to their gender identity, not their sex assigned at birth. The bill has yet to be signed into law.

“Incarcerated transgender people deserve to be housed in facilities consistent with their gender identity,” California State Sen. Scott Wiener said at the time. “When we house trans people based on their birth-assigned gender, we place them at high risk of sexual assault and violence.”

According to the 2015 U.S. Transgender Survey, transgender people are nine times more likely than the general prison population to be sexually assaulted by other inmates.

Crespo’s sentencing statement — in which he said he didn’t want to be housed with a “gay” prisoner — would not stand up as a defense in a California court, because the state is one of eight that has banned the so-called gay and transgender panic defense, which means defendants cannot claim to have been motivated to commit violence by a person’s sexual orientation or gender identity.

Even among the non-incarcerated population, transgender Americans face high rates of violence. LGBTQ advocacy groups have said violence against trans women in particular is at epidemic levels, and the Human Rights Campaign has reported that at least 22 transgender people have been killed in the United States so far this year, but advocates say that is likely an undercount.

Follow NBC Out on Twitter, Facebook & Instagram