A bill that seeks to broaden Massachusetts laws banning discrimination in public accommodations to include gender identity cleared the Massachusetts House on Wednesday.

House members approved House Bill 735 with a 116-36 vote.

The Massachusetts Senate approved a similar bill last month.

The measure comes as 12 states fight a directive from the Obama administration advising schools to allow transgender students to use the bathroom of their choice and as North Carolina resists pressure to repeal a first-in-the-nation law that bars transgender people from using the bathroom that they identify with in government buildings, including schools.

“Today, Massachusetts has bucked a national trend of legislative attacks against the transgender community and offered a simple but powerful acknowledgment to transgender young people, adults and our families: That we are human beings, worthy of respect and deserving of equal protection under law,” Casey Suffredini, co-chair of Freedom Massachusetts, which supports passage, is quoted as saying by the Washington Blade.

Republican Governor Charlie Baker said on Tuesday that he will sign the bill into law.

“No one should be discriminated against in Massachusetts because of their gender identity,” Baker said in a statement. “I would sign the House version in its current form should it reach my desk.”

Baker had come under fire for his tepid support of the legislation.

Eighteen states, plus the District of Columbia, have approved similar protections based on gender identity.