Students from high schools throughout Washington gathered at the Trump International Hotel on Nov. 15 to protest Donald Trump’s election. (Bill O'Leary/The Washington Post)

The election of Donald Trump has Democratic cities from Washington to Los Angeles vowing to protect undocumented residents from being deported, even at the risk of losing millions of dollars in federal funding.

As many as 400 places across the country could be affected by Trump’s campaign promise to deny federal funds to what some call “sanctuary” cities and counties, jurisdictions that have broken with some aspect of federal deportation policy.

In most cases, the sanctuary label means a refusal to cooperate with federal authorities seeking to deport undocumented immigrants who have been arrested for local violations — often by not honoring requests to hold such inmates beyond their scheduled release dates.

But the term could also apply to jurisdictions that prohibit their agencies from denying services to people who are in the country illegally, inquiring about immigration status or alerting federal authorities to suspected illegal immigration.

That puts the District, Prince George’s County, Baltimore and several other jurisdictions in the region on the potential hit list.

D.C. Mayor Muriel E. Bowser (D) (Jabin Botsford/The Washington Post)

D.C. Mayor Muriel E. Bowser (D) and the mayors of Chicago, New York and Los Angeles say they will stand by their policies, arguing that to have local authorities crack down on illegal immigration would destroy the trust in police that law enforcement relies on and would wreak havoc on schools, hospitals and other community institutions.

“We know that our neighborhoods are safer and stronger when no one is afraid to call on our government for help, and when our police can focus on protecting and serving,” Bowser said this week.

Trump pledged during his campaign to withhold federal funds from sanctuary cities and counties part of a set of promises to deport illegal immigrants and build a wall along the Mexican border to prevent others from coming into the country.

Although Trump offered some specifics about his deportation plans in an interview Sunday night on CBS’s “60 Minutes,” saying he would target those who have criminal records or are “drug dealers, gang members,” the president-elect has not clarified which sanctuary cities he would seek to punish or how he would attempt to do it.

Conservative groups say punitive measures against local governments that refuse to hand over those immigrants to federal authorities are crucial, even if it means hurting local schools, community development projects or other services.

“They can attach any set of criteria to any aspect of federal funding to try to incentivize cooperation with immigration,” Dan Stein, president of the ­Federation for Immigration Reform, said about the Republican-controlled Congress. “They could withhold money for highways, for education, for all kinds of things.”

Sanctuary laws received national attention in July 2015 after an illegal immigrant with prior deportations and a criminal history pleaded not guilty to murdering a woman at a San Francisco pier. President-elect Donald Trump has pledged to cut federal funding to sanctuary cities. Here's what they are. (Jayne W. Orenstein and Osman Malik/The Washington Post)

However, with 48 Democrats expected to be in the Senate, passing such legislation could be challenging.

Several bills seeking to withhold federal funds from sanctuary cities have failed in recent years — including one last year that sponsored by Sen. David Vitter (R-La.) that focused on two law-enforcement grant programs and Community Development Block Grants that provide money for affordable housing, infrastructure and anti-poverty programs.

“Until we end all dangerous and illegal sanctuary city policies . . . the obvious first step is to withhold federal funding from those cities refusing to comply with federal immigration laws,” Vitter said Tuesday.

Such a move would be difficult, said Alan Berube, a senior fellow in the Metropolitan Policy Program of the Brookings Institution.

“Unwinding all those federal-local fiscal relationships is a very complicated, legislative, rulemaking, multiyear task that you cannot achieve by executive order alone,” Berube said. “That doesn’t mean the president-elect might not try to do that, but he’ll likely face a bunch of lawsuits if he does.”

Jessica Vaughan, director of policy for the Center for Immigration Studies, said a possible template for future legislation lies in a Justice Department review already underway. It threatens to withhold law enforcement grant money from 10 sanctuary jurisdictions, including New York, Chicago, California and Connecticut, if they don’t change their policies.

The review, launched earlier this year by the Obama administration, so far involved sending letters to those jurisdictions asking them to certify that they’re in compliance with a federal law that requires local governments to share information about undocumented immigrants.

In many cases, the affected grants expire in 2017 and may not be renewed if the policies don’t change, officials said.

“At its most fundamental level, this is a law enforcement issue,” Vaughan said. “If there are jurisdictions that want to cling to their sanctuary policies no matter what, I think the federal government ought to look to litigation to try to compel them to change their policy.”

While several local jurisdictions — including Fairfax and Arlington counties — say they cooperate fully with federal immigration authorities, others that do not are gearing up for the possibility of a confrontation with the Trump administration.

At an emotional news conference Tuesday, Montgomery County Executive Isiah Leggett (D) said his government is prepared to lose federal funds by not assisting immigration officials with investigations unless there is a warrant or federal court order requiring cooperation.

“This is about doing what is right,” Leggett said. “So from my perspective, if I’m faced with the choice of having to lose some federal dollars and run the risk of having our citizens treated in an undignified way, disrespected and hauled off to jail and separated from their families, then I’ll have to lose the dollars.”

In Takoma Park, Md., just outside the District, officials are notifying residents that they do not plan to cooperate with federal immigration authorities. Since 1985, the city of 17,000 people has prohibited police and other employees from cooperating with federal immigration authorities. It also allows non-U.S. citizens to vote in its local elections.

Mayor Kate Stewart said the city council is discussing what to do if it loses about $90,000 in federal Community Development Block Grant money. Some wealthier residents have volunteered to chip in to replace any lost federal funds.

“There are already residents who are willing to step up to help our community,” Stewart said. “That’s what kind of community we have.”

Bill Turque contributed to this report.