(Alice Li/The Washington Post)

District officials warned that the nation’s capital could lose millions — or even billions — in federal assistance annually after President Trump signed a vaguely worded order to crack down on communities that resist the deportation of illegal immigrants.

Speaking Wednesday at the Department of Homeland Security, Trump singled out sanctuary cities, such as the District, Chicago and Los Angeles, as causing “immeasurable harm” to the American people and to the very fabric of our Republic by refusing to help the federal government identify and deport undocumented residents.

Trump directed Homeland Security to examine ways to limit “federal funds, except as mandated by law” to sanctuary cities — wording that puzzled elected officials and municipal attorneys across the country.

Budget officials in the District said the use of the word “funds” could include a wide range of federal assistance to the city, including even $2.5 billion in annual Medicaid contributions — or roughly 20 percent of the city’s total annual spending.

(Claritza Jimenez/The Washington Post)

“This is a federal issue, and the administration should not be dumping it on the cities,” said D.C. Council Chairman Phil Mendelson (D), who said he was worried by the initial assessment of city budget officials.

“I find it offensive that the people who can’t fix the federal immigration policy are trying to put the onus for enforcement on local authorities,” he said, declining to speculate about how the city would proceed with fighting the order.

During a news conference Wednesday night, D.C. Mayor Muriel E. Bowser (D) said the District would remain a sanctuary city, even as she said the impact to the city remained entirely unclear.

“Our city and our values did not change on Election Day,” Bowser said. “Being a sanctuary city means we are not an agent of the federal government . . . . It means that our police can focus on serving D.C. residents — protecting and serving them — no matter their immigration status.”

The District is among many heavily Democratic cities that have embraced the sanctuary label, but one of the few in the region. Other communities, including Montgomery County and Baltimore, walked a careful line Wednesday, seeming not to classify themselves as strictly sanctuary jurisdictions, even as they are widely considered such.

Maryland has cooperated with federal policies on detaining undocumented immigrants since 2015, when Gov. Larry Hogan (R) reversed the noncompliance policy of his Democratic predecessor, Martin O’Malley.

In Montgomery, officials said county arrest and detention information goes to the state and that all state information is accessed by federal authorities.

How sanctuary cities work, and how Trump’s executive order might affect them

Still, its county executive, Isiah Leggett, reaffirmed the county’s policy of minimal cooperation with federal immigration agencies and said he would vigorously contest any attempt to cut off federal funds.

“Clearly, we’re going to fight that, and if needed, we will take appropriate legal action to resist,” said Leggett (D). Montgomery’s government receives more than $200 million a year in federal money.

The definition of “sanctuary” varies significantly from place to place. Some cities and counties merely refuse detainer requests — which occur when the federal government asks a local community to hold an illegal immigrant already in its custody until federal officials can start deportation proceedings. Other communities instruct their local police not to ask about immigration status. And still others issue identification cards and driver’s licenses to undocumented immigrants and provide other services. The District and Chicago recently created legal-defense funds for illegal immigrants.

Immediately after Trump’s announcement, about 100 people gathered at the Columbia Heights Civic Plaza. A stream of speakers took the microphone to denounce the president’s proposed crackdown on sanctuary cities. Protesters held banners reading “#Here2Stay” and “They will not build borders in our community.”

Among the speakers was Ana Rondon, a 43-year-old Columbia Heights resident who came to the District from the Dominican Republic as a child and said she is still undocumented. Rondon, a mother of six who said she volunteers in D.C. public schools, said in an interview that the president’s directives “will get me to trust cops even less.”

“The way I’m feeling right now is sad, depressed, disappointed. Because there’s a lot of people who’s going to be affected by what he’s doing,” Rondon said. She said many of the immigrants she knows in the District are law-abiding and hard-working but are being demonized by the president, who in his speech Wednesday afternoon made repeated references to violent crimes committed by illegal immigrants.

“I just feel like he came out to spread hate, and to do that is exactly the opposite of what America wants — not just immigrants,” she said.

Sapna Pandya, executive director of Many Languages One Voice, the activist group that organized the rally, said the demonstration was intended to prod Bowser to more forcefully defend the District’s sanctuary city policy.

She said the mayor’s recent creation of a legal fund for immigrants was welcomed but insufficient to reassure those who feel at risk of deportation.

“We are asking for specifics from the mayor and her administration about what they are going to do in response to these executive orders,” Pandya said.

Trump’s executive order sent a shock through city halls and county government buildings across the country.

Some, like Boston Mayor Marty Walsh promised outright defiance, saying he would use all city resources to protect the city’s illegal immigrants “even if that means using City Hall itself as a last resort.”

Chicago Mayor Rahm Emanuel vowed not to bend.

“We’re going to stay a sanctuary city,” Emanuel told reporters Wednesday. “We welcome people, whether you’re from Poland or Pakistan, whether you’re from Ireland or India or Israel, and whether you’re from Mexico or Moldova, where my grandfather came from, you are welcome in Chicago as you pursue the American Dream.”

In San Francisco, Mayor Ed Lee expressed a mix of defiance and confusion about the specific threat his city faced.

“We receive about $1 billion in federal moneys,” Lee told reporters. “But I’m not sure at all, and neither is the city attorney, about the language they used and what’s under review at this time.”

By evening rush hour in the District, more than 400 protesters marched near the White House, chanting in favor of immigrants and blocking traffic on 15th Street NW. They unfurled banners in front of them on the street that said “Donald Trump is a Racist,” “Islamophobia Kills” and two large footprints with the silhouettes of people inside.

Among the undocumented immigrants who showed up was Catalina Velasquez, a transgender woman who has lived in the country for 15 years and received legal protections under the Obama administration for people brought to the country illegally as minors.

She says her entire family was deported back to Colombia in 2009, and she fears if she joins them, she faces the risk of violence and discrimination because of her gender identity, including from disapproving relatives.

“If I am deported, I am deported to a death sentence. I am a trans woman — it’s not safe for me anywhere I go,” said Velasquez, 29. “But this is the safest.”

Bill Turque, Arelis R. Hernández and Josh Hicks contributed to this report.