SACRAMENTO, Calif. — California lawmakers passed a proposal Monday that would require all single-person public restrooms to be gender neutral, hours after North Carolina’s governor sued the federal government to defend that state’s law requiring transgender people to use the restroom matching the sex on their birth certificate.

Members of the California Assembly voted 52-18 on an initial ballot in favor of the proposal from Democratic Assemblyman Phil Ting of San Francisco, who says it aims to help transgender people, parents with kids of different genders and adults caring for aging parents.

His proposal would apply to all businesses in California as well as state and local government buildings.

“California is a place of inclusion,” Assemblyman Evan Low, D-Campbell, said in support of the proposal. “Let’s make a clear statement that, if you want to go pee, by all means help yourself.”

Assemblyman David Chiu, D-San Francisco, said he was co-authoring the legislation on behalf of “thousands of transgender individuals in the state of California who feel unsafe in bathrooms, who feel harassed in bathrooms, who are questioned when they walk into a bathroom.”

Republican Assemblyman James Gallagher of Plumas Lake opposed the proposal, saying men’s messy habits will inconvenience many more people than the bill would help.

The legislation now moves to the state Senate, where it must pass before going to Gov. Jerry Brown.