BOSTON (CBS/AP) — Immigrants and advocacy groups crowded a Beacon Hill hearing room to voice their opinions on whether or not Massachusetts should become a so-called sanctuary state.

The Legislature’s Committee on Public Safety and Homeland Security heard testimony on the Bill Friday. If passed, the proposed legislation would place limits on cooperation between federal immigration officials and state and local law enforcement agencies.

The debate comes amid heightened concerns in some immigrant communities about President Donald Trump’s policies. An executive order issued by Trump though later blocked by a federal judge would cut funding to sanctuary cities.

Dozens of legislators have signed on as co-sponsors of the bill, but passage is far from assured.

Republican Gov. Charlie Baker and Democratic House Speaker Robert DeLeo say they oppose the bill. They prefer to leave sanctuary status up to individual cities and towns.

“This legislation would… prevent the Massachusetts State Police from upholding our policy to detain individuals for federal authorities that have been convicted of heinous crimes, like murder and rape, and weakens current public safety measures that are designed to keep us safer,” said Governor Baker. “Our administration does not support making the Commonwealth a sanctuary state and urges the Legislature to hold this bill in committee and reconsider ways to ensure Massachusetts remains a welcoming place while maintaining public safety.”

In Somerville, one-third of the city’s residents are foreign-born. Mayor Joe Curtatone supports the sanctuary state bill.

“We must make it clear that we will not follow along and allow some in the federal government and even here, in this Commonwealth, demonize immigrants,” said Curtatone at the hearing.

Supporters at the hearing weighed-in, claiming the bill would be good for Massachusetts. Barbara Madeloni accused Hodgson of fear-mongering.

“This legislation will actually make our communities safer because it will make it safe for people in the community to approach law enforcement,” Madeloni said.

However, Bristol County Sheriff Thomas Hodgson said the legislation would cut off vital communication lines between state and federal law enforcement agencies.

“Making Massachusetts a sanctuary state restricts our relationship with ICE,” Hodgson said. “Why in the world should we work with fewer law enforcement agencies? Why should we share less information?”

“This is a public safety issue,” he said. “It is my sworn duty as a sheriff to do everything in my power to keep the citizens in my county and this state as safe as possible.”

According to the sheriff, local authorities would be prohibited from alerting ICE when illegal immigrants are going to be released from custody unless they’ve committed a serious violent offense.

He also said that if the bill passed, he would defy it.

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)