After nearly six hours of debate, the House made sure to pass the version of the transgender accommodations bill introduced by House leadership, the same version Gov. Charlie Baker said yesterday that he would sign if passed to his desk.

On the eve of the debate, the pressure on House Speaker Robert DeLeo to pass the measure by enough votes to make the governor's opinion irrelevant shifted to pressure to keep the bill exactly as Baker preferred. Baker's announcement yesterday that he would sign the House's version of the bill, as long as it retained provisions to lay out punishments for abusing access rights, turned from a vote to overrule the executive veto pen to one embracing Baker's signature.

In the end, the 116-36 vote margin did indeed produce enough "yeas" to protect the legislation from a Baker veto.

"You look back at the history of Massachusetts and our legacy in terms of civil rights and what we have done and you consider the fact that this is just another great moment in our history and it really makes you really so proud to be from Massachusetts," DeLeo said after the vote.

The senate passed their own version of the legislation, without Baker's preferred punishment provisions, last month. It's now up to Senate President Stan Rosenberg's chamber to reevaluate the House's version. The upper chamber could choose to adopt it wholesale and rush a final bill to Baker's desk for his signature. The Senate wasn't enthusiastic about DeLeo's alterations, and could force the bill into a conference committee to reconcile the versions if the more liberal membership decides to press the issue.

One of the strongest opponents of the bill has been Rep. James Lyons, the conservative Republican from Andover. Lyons has stressed that expanding the access rights of transgender people would come at the cost of privacy rights for everyone else in the community, especially those offended or made uncomfortable by sharing changing areas with someone of the anatomical opposite sex.

"This legislation, folks really  has absolutely nothing to do with discrimination. It has everything to do with changing our society and social engineering by those on the left. That is what this bill's about," Lyons said on the House floor.

Competing chants of "shame on you" from opponents were eventually overtaken by calls of "thank you" from proponents as House members exited the chamber.

A surprise of the earlier portion of the debate came when Rep. Sheila Harrington (R-Groton) took to the podium to say she was wrong to vote against the original 2011 civil rights bill that expanded most protections to transgender individuals.

The 2011 law was passed and signed by Gov. Deval Patrick only after provisions on accommodations were removed amid fierce opposition from socially conservatives Democrats and Republicans. LGBT advocates consider today's bill the final piece of that landmark legislation.

The bill still needs final Senate approval since they haven't yet approved language cracking down on the abuse of access rights - a provisional Baker insists on for his signature.

In a statement released after the vote, Senate President Stan Rosenberg said his chamber "looks forward to working with the House to send a bill to the Governor’s desk.”