Government agencies in Maryland’s most populous jurisdiction are now banned from cooperating with federal immigration raids or investigations, in what advocates say is the strongest action taken in support of undocumented immigrants in the Washington region.

Montgomery County Executive Marc Elrich (D) on Monday signed the Promoting Community Trust Executive Order, prohibiting all executive-branch departments from, among other things, using local government resources to assist federal agents in civil immigration investigations.

That means they cannot allow U.S. Immigration and Customs Enforcement officers into nonpublic spaces in government buildings or give them access to individuals in county government custody — unless they are in possession of a court order or criminal warrant.

The order, which advocates said was the first of its kind in the region to be codified and applied jurisdiction-wide, comes as the Trump administration is upping its ­anti-immigrant rhetoric and vowing widespread crackdowns. The president announced in recent weeks that massive raids were imminent, sparking fear in foreign-born communities even though no significant uptick in arrests has been reported.

Gustavo Torres, executive director of the immigrant advocacy group CASA, said Elrich’s order was an “extraordinary ” action. Jim Huang, a member of the Montgomery County chapter of Showing Up for Racial Justice, said it is “a very, very positive step forward.”

Police in Montgomery, where immigrants make up 30 percent of the 1 million residents, have refused since 2014 to cooperate with ICE agents on immigration enforcement, which is considered a civil matter rather than a criminal one.

Individual government departments have also had internal policies preventing employees from assisting in immigration raids, officials said.

But Torres said these efforts have not been foolproof and that his organization’s employees have heard of instances of undocumented immigrants being arrested and deported after interacting with local police.

In the face of the ongoing White House efforts, Torres said, “the Montgomery way,” which local officials use colloquially to refer to the county’s values of diversity and inclusion, needed to be formalized.

Elrich, who took office in December, agreed. “Now, we’ve laid it out in an Executive Order, so it has the force of law,” he said in an interview, adding that employees who violate the order will receive disciplinary action.

“It’s not just symbolic that I did this,” Elrich said. “This legally codifies what I said I was going to do, and residents can have this assurance.”

Several other jurisdictions in the Washington area also have strengthened their protection of immigrant communities in recent months.

Most recently, neighboring Prince George’s County last week published new policies and launched training efforts to prohibit officers from cooperating with ICE, after reports that several undocumented immigrants had been placed in deportation proceedings following interactions with police.

Montgomery officials stopped short of saying that Elrich’s order qualifies the county as a “sanctuary jurisdiction” — a controversial and often slippery label that draws the ire of the White House and sparks heated debate even in left-leaning jurisdictions.

Small cities in suburban Maryland, including Hyattsville and Takoma Park, have declared themselves sanctuaries. But in 2017, amid Trump’s threats to withhold government funding from sanctuary cities, Montgomery officials said that they did not think the county’s policies qualified for that label.

County Council President Nancy Navarro (D-District 4) said local officials prefer to discuss specific policies the county implements rather than broad descriptors or categorizations.

Advocates have pushed for counties to adopt stronger barriers with ICE, and protections for immigrants, since a statewide Trust Act failed two years ago. They said they will now ask Montgomery to pass legislation that echoes and codifies the executive order.

“The burden of responsibility right now rests again on the County Council,” Huang said.