SACRAMENTO, Calif. (AP) -- Inmates in California prisons would be housed by their gender identity according to a bill moving through the state Legislature.

The California Senate voted 29-7 on Thursday to require the California Department of Corrections and Rehabilitation to ask inmates their gender identity and to put them in prisons designed for that gender. The only exception would be if the department believed it would pose a significant security risk.

The bill would require the department to refer to inmates by their preferred gender pronoun.

Bill author Sen. Scott Wiener, a San Francisco Democrat, says transgender women put in prisons with men are often assaulted and raped and put in isolation for their safety.

The bill now heads to the state Assembly.

