Boston-area officials vow to stand behind undocumented immigrants who live in their communities in the wake of President-elect Donald Trump’s pledge to crack down on sanctuary cities.

There are more than 185,000 undocumented immigrants in Massachusetts, most of whom are concentrated in the state’s urban areas, according to a 2012 study by the Malden-based Immigrant Learning Center.

For years, such cities as Boston, Cambridge, Chelsea, and Somerville have refused to cooperate with federal Immigration and Customs Enforcement agents based on local sanctuary city bylaws.

Under those provisions, local employees and police do not hold undocumented immigrants as outlined by federal law and only turn them over to ICE if there is a warrant for their arrest.

Proponents of sanctuary city protections say they protect families and public safety by providing a safe environment for undocumented immigrants afraid of deportation to come forward.

But the president-elect outlined a plan that would put the pressure on cities that protect undocumented immigrants from prosecution, stating that such laws only serve to insulate criminals from prosecution.  

In his Aug. 31 speech on immigration policy, Trump said he would defund communities with sanctuary city statutes.

“Cities that refuse to cooperate with federal authorities will not receive taxpayer dollars, and we will work with Congress to pass legislation to protect those jurisdictions that do assist federal authorities," Trump said.

If he follows through on this campaign promise, Boston would stand to lose about $250 million, a loss that Mayor Marty Walsh called “catastrophic” in a recent Boston Globe report. Despite the possible loss of funding, Walsh said he is committed to protecting all immigrants.

“I am proud that Boston has a long history of supporting all immigrant families, no matter where they come from, including my own,” he said. “We are a welcoming city for all and are committed to fostering an environment where all members of our community have opportunities to contribute and thrive. Those are Boston’s values and no policy will change them.”

Chelsea City Manager Thomas G. Ambrosino said a loss of federal dollars would be most evident in public schools, which would likely see a decrease of a few million dollars.

“I think being a sanctuary city is an important policy statement for the city. We are an overwhelmingly minority community at 65 to 75 percent Latino. We have a lot of immigrants here, some of whom are certainly undocumented, but we pride ourselves on being a welcoming community for everyone,” he said.

In Somerville, federal dollars account for about 3 percent of the annual budget, so while the impact might not be catastrophic, it would definitely make a dent, Mayor Joseph A. Curtatone said.

“If it comes to fruition, the rough math is it would be about a $6 million difference. But that money supports programs like school lunch, it advances teaching, Title I, homeland security and Head Start—the very programs that help urban centers like Somerville thrive and that Trump said on election night he is committed to keep,” he said.

There has been no word from the president-elect on whether he will follow through on this campaign promise. As Trump has already softened on some rhetoric, specifically on his intended deportation of Muslims and decision to build a wall at the U.S.-Mexico border, some local mayors are hoping for the best.

“It remains to be seen what will actually happen. I’ll give him the benefit of the doubt and when he looks at the reality of the negative impacts, maybe he’ll be open to a more prudent and common sense approach to our immigration system as a whole. It’s about time Washington D.C. took a bi-partisan approach to getting that done,” Curtatone said.