The mayor of a wealthy liberal enclave next to Boston posted a rebuke to President-elect Donald J. Trump Monday, pledging his city of Somerville to be a sanctuary city regardless of pressure from the incoming administration and the possible loss of federal funds.

“This is the heartbreaking part of the election: the sheer number of people who feel like the Trump campaign was predicated on breaking faith with one another,” wrote Mayor Joseph A. Curtatone, whose 4.2 square mile city has roughly 80,000 residents, more than 80 homes listed for more than $500,000, and more than 25 of those homes listed for more than $1 million.

“In the wake of the election, our phones have been ringing off the hook. We’ve heard from parents who fear they will be rounded up while their young children wait for them at home,” he said.

“We’ve heard from women, Muslims, members of the LGBTQ community, and students of color fearing intensified discrimination,” the Somerville Democrat said.

The mayor said that he is not afraid and he will not surrender.

“Political parties win and lose. Yet this election has made people question whether our leaders desire to maintain a diverse, tolerant society,” he said.

“The message we jointly want to send to those whose confidence has been shaken is this: Our city—Somerville, Massachusetts—will not waver,” said the mayor, who once blocked the permitting process for an Olive Garden restaurant but cut the ribbon for the city’s new Planned Parenthood office.

Curtatone has a long history of political radicalism, such as when in July the mayor hoisted a large “Black Lives Matter” banner over the front door of city hall. When the city’s police officers’ union formally requested the mayor replace the banner with one that read: “All Lives Matter,” Curtatone dismissed their request out of hand.

The mayor said his definition of a sanctuary city is one where his police and agencies do not run immigration checks on residents, nor take care that would trigger an adverse government action for a resident, unless there is a violent crime involved.

“No one who commits violent, felony, or serious crimes gets a free pass here. We do cooperate with immigration on those cases,” he said.

The mayor wrote that he knows that federal funding is at risk.

“President-elect Trump has threatened to pull federal funding from sanctuary cities,” he said.

“How much federal funding could we lose? A lot. Currently Somerville receives approximately $6 million in recurring federal funds per year for things like special education, school lunch programs, substance abuse prevention, and homeland security,” the mayor said.

Federal funding is three percent of the city’s annual budget, in addition to housing grants, whih are applied for annually, he said.

“If we lose this funding, we will tighten our belts, but we will not sell our community values short,” he said.

Curtatone said he was willing to call the President-elect’s bluff.

“Mind you, our hope is that once our new president reviews accurate information, he will not cut this funding,” he said.

“It would be a reckless policy.”