A controversial Massachusetts sheriff told a congressional panel Tuesday that arrest warrants should be issued for elected officials of communities that he said "harbor and conceal illegal aliens" from federal immigration authorities.

Testifying at the House Judiciary Committee's Subcommittee on Immigration and Border Security, Bristol County Sheriff Thomas Hodgson directed his criticism at so-called "sanctuary cities" and their leaders.

"At best, sanctuary cities are a direct violation of trust between the legal residents and the elected officials who took an oath to protect them at all costs," he said, according to his prepared remarks. "At the worst, it’s careless, illegal and extremely dangerous."

He then added: "If these sanctuary cities are going to harbor and conceal criminal illegal aliens from [Immigration and Customs Enforcement], which is in direct violation of Title 8 of the U.S. Code, federal arrest warrants should be issued for their elected officials."

Leaders of some Massachusetts "sanctuary cities" say they comply with Title 8, cooperating with ICE when it comes to apprehending serious criminals. The fact that their police do not collect immigration status information, these leaders says, is not a violation of federal law.

And in a statement submitted to the congressional subcommittee, the Massachusetts Immigrant and Refugee Advocacy Coalition said that "in no reasonable way can the failure to honor [an ICE] detainer be interpreted as concealing, harboring, or shielding an undocumented immigrant."

Hodgson's testimony came a day after U.S. Attorney General Jeff Sessions detailed the Trump administration's threat to withhold some grants from state and local jurisdictions that limit their cooperation, and the information they share, with federal immigration authorities.

Sessions' announcement was met with push-back from several Massachusetts officials.

"The threat of cutting federal funding from cities across the country that aim to foster trusting relationships between their law enforcement and the immigrant community is irresponsible and destructive," Boston Mayor Marty Walsh said in a statement Monday.

The cities of Chelsea and Lawrence have filed suit against the Trump administration for its executive order, in January, that threatened to pull federal funding from "sanctuary cities."

On Tuesday, Hodgson said "there's arguably no bigger threat to public safety than illegal immigration." On immigration issues, the Republican is often on the opposing side from Massachusetts politicians.

That same day, a Facebook post by state Rep. Michelle DuBois, a Democrat and former Brockton city councilor, drew widespread attention and criticism. The post, which is no longer publicly available, said, in part:

"I got the following information from my friend in the Latin community: I have a message for the immigrant community of Brockton. Please be careful on Wednesday [March] 29. ICE will be in Brockton on that day. If you are undocumented don't go out on the street. If there is a knock on the door of your house and you don't know who it is, don't open the door. I ask you to be careful."

Following a wave of response — much of it negative — DuBois later justified the posting in an update, saying her statement was "forwarding a rumor that is all over Brockton."

In a statement Wednesday, ICE spokesman Shawn Neudauer said that while ICE does not release information about its operations, it does not engage in random raids as its operations are based on investigative leads.

"Any person who actively incites panic or fear of law enforcement is doing a disservice to the community, endangering public safety and the very people they claim to support and represent,” Neudauer said in the statement.

After hearing about DuBois' post, Hodgson's office tweeted Tuesday remarks he made to the subcommittee in response:

In January, Hodgson and the Plymouth County sheriff signed a partnership with federal officials to increase immigration screenings among their inmates. And two weeks earlier, Hodgson offered to have his inmates help build President Trump's promised southern border wall.

At the time, Republican Gov. Charlie Baker said he would prefer the sheriff to "continue to offer [inmate work project] services closer to home."

With reporting by WBUR's Benjamin Swasey, Shannon Dooling and Lisa Creamer