Prison bars/Photo courtesy of Shutterstock.com Photo: Shutterstock.com

Inmates in New York City's jail system will be housed with fellow inmates of the gender they identify with, officials said Monday.

The announcement by Democratic Mayor Bill de Blasio and the city commissioner of human rights means New York will join San Francisco in establishing a policy to accommodate transgender inmates.

“Respecting someone's gender identity or gender expression is key in making sure that everyone in New York City is living with dignity and respect,” said Carmelyn Malalis, the commissioner of human rights. “The fact that somebody's incarcerated or not doesn't really change that.”

De Blasio signed an order in 2016 directing all city-owned schools, recreation centers and other buildings that have single-sex bathrooms and locker rooms to let people use the bathrooms of the gender they identify with.

The Department of Correction initially received a partial exemption from the order because of inmate safety concerns.

Under the new policy, the Department of Correction will house inmates consistent with their gender identity unless the outcome of a federally required safety assessment or the preferences of the inmate require alternative housing. A transgender housing unit is an option for some inmates.

The Department of Correction will have six months to implement the policy.

San Francisco officials announced in 2015 that it would house transgender inmates based on their gender identity.