New York City will begin housing inmates according to their gender identity instead of their sex, according to a report from the Observer.

A statement from the mayor’s office announced that transgender and gender non-conforming individuals will be given “safe and gender-affirming housing options” beginning in October. “It’s the city’s responsibility to protect the rights and safety of all New Yorkers and that means protecting transgender individuals in city jails as well,” Mayor Bill de Blasio said in the statement.

New York City is one of the first major cities to begin recognizing inmates' gender. San Francisco became the first city in the country to “permit individuals who identify as transgender, gender variant, or non-binary to pick their preferred housing,” according to the Observer.

Research shows that transgender and gender non-conforming inmates forced into housing based on their assigned gender often face more physical and sexual violence in lock-up. As Jezebel points out, a 2009 California study showed that transgender individuals are 13 times more likely to be sexually assaulted than other inmates.   

“With today’s announcement, New York City takes another important step to protect the rights, dignity and safety of transgender and gender non-conforming individuals, and it is our hope that cities across the country will follow our lead,” First Lady of NYC Chirlane McCray said in a statement. “Keeping transgender and gender non-conforming New Yorkers safe, wherever they are, is the city’s responsibility—whether they are in city custody or walking through their own neighborhoods.”

The Department of Correction has six months to comply with the new requirements, set by the New York City Human Rights Commission, which mandate that people can access the city’s single-sex facilities according to their gender identity without medical documentation.