Bills that add gender identity to the protections for people using bathrooms and other public accommodations have now been approved by both houses of the Massachusetts legislature, in what's being hailed as a victory for LGBT rights activists.

The House approved its version of the bill Wednesday by a vote of 116-36; the Senate endorsed a similar bill last month by a 33-4 margin. The legislation will now go to a conference committee to resolve differences between the two versions.

As member station WBUR reports, the governor is expected to sign the measure that's known as H 4343 in the House and as S 735 in the Senate:

"Gov. Charlie Baker, a Republican, shed his neutrality Tuesday on the eve of the House debate by coming out in favor of the House's version, indicating he would sign that bill after 'hearing from all sides.' "

Both versions of the legislation call for the state's anti-discrimination commission to enforce the law. But in one key difference, the House bill also compels the attorney general's office to give guidelines to law enforcement agencies that might face cases of people who assert gender identity rights "for an improper purpose."

The House version also doesn't enact the legislation until the start of 2017.

Today's vote on the bill drew the largest crowd of the current session of the Massachusetts General Court, says WBUR, which adds that the debate was an emotional one.

Here are two sample quotes, from WBUR:

"The bill allows people on a routine basis to decide if they are male or female. Your anatomy is no longer relevant. This has absolutely nothing to do with discrimination, it has everything to do with changing our society and social engineering by those on the left. I'm not interested in changing society." — Rep. James Lyons, a chief opponent of the bill;"You can't tell people it's OK to work at the diner, but it's not to sit at the lunch counter. We learned that a long time ago." — Rep. John Fernandes, a supporter of the bill.

One group that opposed the bill, the Massachusetts Family Institute, recently called it "one of the worst pieces of legislation on Beacon Hill" and urged opponents who could attend today's debate to wear blue in a sign of solidarity. The group also criticized the one-hour limit that was placed on debate over the bill.

Responding to today's vote, the ACLU chapter in Massachusetts said:

Copyright 2016 NPR. To see more, visit