(Drew Angerer/Getty)

Transgender convicts will be imprisoned in the facility corresponding with their true gender for the first time.

Connecticut’s government has changed the law to respect inmates’ gender identities, making it the only state in the US to have done so.

The legislation will come into effect on July 1, according to the Associated Press.

As well as meaning that trans people will no longer be forced into confined spaces with people of the opposite gender, the new law also allows prisoners to wear and purchase clothing which matches their gender identity and to be addressed by their chosen name and pronouns.

There are around 3,200 trans prisoners in the US, and they often suffer horrific experiences when they are made to stay in prisons not matching their gender.

One trans woman who has been living as female for 40 years was reportedly forcibly strip-searched by male guards in an all-male Massachusetts prison after being jailed for a non-violent drugs offence.

Her representatives said she was also “regularly subjected to… groping by male correctional officers.”

Another trans inmate, Lindsay Saunders-Velez, is suing after she was allegedly raped at a men’s prison in Colorado.

Connecticut’s move comes as President Donald Trump’s administration rolls back rights for trans prisoners on a federal level, moving to deny them the ability to use facilities – including bathrooms and cell blocks – which match their gender identity.

The changes go against efforts by the previous Obama administration to ensure transgender inmates are protected from sexual assault and abuse, and follow a lawsuit filed by four evangelical Christians in a Texas prison.

Connecticut ACLU executive director David McGuire hailed the state’s law change, saying: “This is a really big deal.

“It is, in our mind, the most protective transgender policy and law in the country.”

Mike Lawlor, the governor’s undersecretary for criminal justice policy, debunked a common misconception.

“I’m sure there will be people who will say, ‘So how does this work?” he said.

“If you are a guy, do you just say you’re a woman and you get to go to a woman’s prison? No. There is a very elaborate analysis, psychological and otherwise.”

Prisoners must either be diagnosed with gender dysphoria or be legally recognised as their gender of choice to benefit from the law change.

Jennifer L. Levi, transgender rights project director for GLAD (GLBTQ Legal Advocates & Defenders), said the legislation would set an example to other state governments that positive change was possible, despite Trump’s discriminatory agenda.

This was particularly important, she said, as trans prisoners suffered more than most inmates.

“There are many states for which transgender people are basically serving double sentences,” said Levi.

“One for the underlying crime for which they’ve been convicted of and the other just for being transgender.”