The state Senate is expected to pass landmark legislation Thursday prohibiting discrimination against transgender people in public facilities.

This would mean that patrons using public spaces—such as locker rooms or lavatories—would choose between the men's and women's accommodations according to the gender with which they identify.

Senate President Stan Rosenberg is confident the bill will pass his left-leaning chamber, where Democrats outnumber Republicans 33 to five. 

The stage will then be set for stages two and three: Does House Speaker Robert DeLeo, a supporter of the bill, have the votes in his moderate chamber to put the legislation onto Gov. Charlie Baker's desk by the end of this session? And will Baker sign it—as he has hinted he will?

The legislation differs between the House and Senate versions, with the House including language to instruct law enforcement officials to spell out penalties and processes for individuals caught abusing access. 

The House-favored language added to the bill would instruct the attorney general to "issue guidance or regulations" for pursuing criminal legal action against anyone caught asserting "gender identity for an improper purpose." 

It could be a tough vote for many Democrats in the House who face opponents in November or need to answer to constituents more socially conservative than the attitude statewide.

Rep. Michael Day (D-Stoneham) told WGBH News he's been having conversations directly with constituents who air concerns over the legislation.

"A lot of them, due to some of the rhetoric around this issue, confuse or blend transgender individuals with sexual predators," Day said.

To explain why he supports the measure, Day said he's been clear with anyone who asks him about what a transgender person actually is and that he takes pains to explain that the bill would correct the "loophole" of the 2011 law that established protections in employment and housing for transgender people, but left out public accommodations.

Some of his constituents' concerns have been around informing businesses how to comply with any new law and what penalties would be at stake for either abusing or denying the new levels of access.

The Massachusetts Family Institute, a socially conservative advocacy group, hosted author Kaeley Triller at a press conference in the State House Wednesday and pressed the concerns shared by many in the state that opening the door of gender-specific accommodations to transgender people would create a threat to public safety. The law, they argue, would allow predatory men to claim a female gender identity in order to prey on women in gender-segregated areas.

"The most important competent of any safety plan is prevention. And that's what this blurs," Triller, a sexual abuse survivor, said.

Triller said transgender people need reasonable accommodations and deserve respect for their safety and privacy.

"But that doesn't need to look like stripping voices from people who are already vulnerable. That doesn't need to look like telling women to 'get over it,'" Triller, whose book  “A Rape Survivor Speaks Out About Transgender Bathrooms,” told the crowd of around 50 people gathered at the State House's Grand Staircase.

"Massachusetts law already prohibits anyone from entering a restroom or facility to invade a person’s privacy, and this bill does not change that," Carly Burton, campaign manager for the group pushing the bill, Freedom Massachusetts, said in an emailed statement shortly after Triller's remarks.

The fight over House votes has gotten ugly in some areas. Proponents have accused opponents of peddling hate and exaggerating the threat posed by sexual predators who'd take advantage of the law.

"It's unfortunate that some of these groups have been, as I say, fear mongering here," Day said. "My church for example, when I was attending, got leafleted against me, saying, 'He's a cosponsor. Tell him not to vote in favor of this.'"

Another persistent argument challenging the bill surrounds privacy rights for those sharing the public areas with those who identify as transgender. Rep. Jim Lyons (R-Andover) spoke out about the "conflict of rights" when the bill was heard publicly last year.

Lyons sees it as the simple issue of sacrificing the longstanding expectation of privacy in gender-specific locker rooms and bathrooms in favor of protecting a very small number of transgender individuals.

"What this bill basically does is take away rights from 99.9 percent of the population," Lyons said. "For what? I don't think it's something we ought to do."

Day disagrees.

"I think we all have a basic right to a certain level of privacy in a restroom and I don't think this impinges on that right," Day said.

Lyons points to Massachusetts's move in 2007 to create abortion clinic "buffer zones" as an example of the Legislature getting it wrong. Lawmakers limited where anti-abortion protesters could demonstrate in order to ease access to health care facilities that provide abortion services and to protect patrons from potential threats or violence.

"... The United States Supreme Court unanimously held that the Massachusetts law was overly restrictive and violated the free speech rights of peaceful protestors," Lyons wrote in a recent op-ed in the right-leaning New Boston Post.