A "no" vote on Question 3 would have repealed the law signed in July 2016. With the "yes" vote, people can use bathrooms and other public facilities consistent with their gender identity.

The measure is the first statewide referendum to put the question of protections for transgender people in voters' hands. In 2015, Houston voters repealed a citywide anti-discrimination ordinance protecting gender identity in public accommodations; this year, Anchorage voted to retain theirs.

"This victory is one for the history books. Tonight, Massachusetts became the first state in the country to uphold transgender protections at the ballot box!" Freedom Massachusetts tweeted Tuesday.

What the law does

Opponents of the law say the referendum was about protecting public safety and privacy.

The group that brought the question, Keep MA Safe, said the law lets people "self-identify" however they wish, leaving the door open for people to impersonate members of the opposite sex for unlawful purposes, such as entering public restrooms to harass or assault women and children.

Keep MA Safe feared that could lead to situations that result in criminal or civil penalties for those who complain about misuse of single-sex facilities, the group's spokeswoman Yvette Ollada said.

No official data exists to support either of these claims. Research compiled by the National Center for Transgender Equality shows that transgender people are the ones who are more likely to experience violence or harassment for using restrooms that match their gender identity. Advocates say laws such as the one in Massachusetts are necessary for their safety.

State issues guidance

In guidance issued after the law took effect two years ago, the Massachusetts Attorney General's Office emphasized that it does not protect anyone who engages in improper or unlawful conduct in a restroom or elsewhere.

The guidance says places of public accommodation should not assume a person's gender identity based solely on appearance, and noted that "misuse of sex-segregated facilities is exceedingly rare."

Ollada said the law puts the onus on a patron to confront the person they suspect of misusing a restroom. But neither the law nor the attorney general's guidance suggest that a customer should take such action.

If a patron suspects another person of using a facility improperly, the guidance directs businesses to assess the claims. If the business has reason to believe a person is misusing a facility, they can ask the person to produce state-issued identification or a letter from a health care provider, clergy or friend attesting to their gender identity.

Civil rights activists say the referendum is the latest effort to undercut civil rights for transgender people using the bathroom predator myth