City Hall flew the transgender pride flag this month. Mayor Marty Walsh pledged toMetro File

The Massachusetts Senate on Thursday passed its version of a bill granting new protections to transgender individuals.


The bill passed 33-4.Republican Sens. Bruce Tarr, Ryan Fattman, Vinny deMacedo and Donald Humason voted against the bill, according to the State House News Service.


The vote comes after a monthslong battle over the legislation, which would outlaw discrimination against transgender people in public places, among them parks, restaurants and public bathrooms. A 2011 state law adding protections for transgender people did not include language on public accommodations.


The issue of bathroom use by the transgender population has become a national political flashpoint, with presidential candidates weighing in and North Carolina passing a law that restricts access to bathrooms to birth gender, rather than identity. The law has been challenged by the U.S. Justice Department and sparked protests and tourist and economic boycotts.


In a prepared statement on Thursday, Kasey Suffredini, co-chair of Freedom Massachusetts, a coalition that has argued in favor of the bill, called Thursday's vote “historic.”


RELATED: Transgender pride flag raised at City Hall

The bill’s passage “sends a message the transgender community has longed for decades to hear – that we are truly welcome and valued in our Commonwealth,” Suffredini said. “We urge the House to swiftly bring this bill to a vote and bring it one step closer to the governor’s desk and becoming law. Massachusetts is ready.”

"My heart breaks with gratitude. I can't thank you enough," Lorelei Erisis, a transgender woman from Ayer, said in a press conference to Senate Democrats, according to the News Service.

Opponents have referred to the legislation disparagingly as the “bathroom bill,” because it would make it illegal to deny people from using the bathroom that corresponds with their gender identity. They have argued it would violate privacy rights, particularly for women and young girls.

Humason, a Republican senator from Westfield, explained his "no" vote to the News Service.

“Ultimately, I guess my concern was any time there is no set standard and it's based simply on self-identification and that self-identification can change from one day to the next that becomes very difficult as a legislator to support and as a government to institute," he said. "It's almost unenforceable, because it's based simply on how someone feels on that particular day."

An amendment to the bill, which would have sought to punish those who abuse the law to enter bathrooms for improper purposes, failed 26-11, according to WBZ Newsradio’s Ben Parker.

Earlier in the day, senators voted 33-4 to add language to the bill making it take effect immediately if it is passed and signed into law.

"In Massachusetts we are civil rights pioneers by nature," said bill sponsor Sen. Sonia Chang-Diaz, who sponsored the amendment, according to the News Service.

RELATED: Bathroom access for transgender individuals: a city-by-city guide

A debate in the House, where the bill faces more opposition, is expected in the coming weeks.

Gov. Charlie Baker has not voiced an opinion either way on the bill, but his administration has suggested he would not veto it.