Opponents and supporters of the proposal to designate Howard County, Md., a sanctuary county wait in the hallway to be seated before the council’s vote on Feb. 6. (Katherine Frey/The Washington Post)

President Trump’s plan to arrest and deport vast numbers of undocumented immigrants is forcing officials in liberal localities to tread a delicate line: keeping true to their values, which include protecting diverse communities, while staying out of the crosshairs of a federal government that has vowed a different approach.

Leaders in Montgomery County, Maryland’s largest jurisdiction, believe they’ve struck the proper balance — a nuanced mix of uncodified practices that keep most undocumented immigrants who are in police custody at arm’s length from federal authorities, while ensuring that those who have committed the most serious crimes are handed over.

But a bill moving through the Maryland General Assembly would go further. The Trust Act proposes sweeping prohibitions on the ability of communities to cooperate with U.S. Immigration and Customs Enforcement (ICE), potentially jeopardizing federal funding and collaboration on a host of other issues.

It would bar the state, counties and cities from most communication with ICE and prohibit jurisdictions from participating in the agency’s 287(g) program, which trains police and corrections officers to assist with federal immigration enforcement. Thirty-seven cities and counties across the country have joined the program, including Frederick and Harford counties in Maryland. Anne Arundel County recently applied.

Montgomery County Executive Isiah Leggett (D) (Jeffrey MacMillan)

Montgomery County Executive Isiah Leggett (D) earlier this month announced his opposition to the Trust Act, one of a host of immigration-related proposals being considered in statehouses across the country. Leggett denounced Trump’s deportation and border policies, but contended that passage of the bill would make Maryland a target for tougher enforcement, or reprisals that could cost the region long-sought federal prizes, such as a new FBI headquarters that Maryland wants to locate in Prince George’s County.

The bill places liberal-to-the-bone Montgomery in the awkward position of fighting a proposal based on the values it claims to embrace: diversity, inclusion, tolerance, respect. Leaders sometimes call it “The Montgomery Way.”

“I think we are all caught in a very difficult dilemma,” Leggett said. “We all think to our core this administration is wrong. People are searching for solutions.”

The Montgomery County Council has taken no position on the Trust Act, sponsored by Sen. Victor R. Ramirez (D-Prince George’s) and Del. Marice Morales (D-Montgomery), but is scrambling to craft amendments that push it closer to Montgomery’s stance. Members are expected to discuss the proposed changes Monday.

“We think we have the right approach,” said council member Hans Riemer (D-At Large).

At the same time, the council has shown little enthusiasm for a proposal floated this month by Gustavo Torres, head of the state’s largest immigrant advocacy group: that Montgomery pass its own version of the Trust Act.

Torres, executive director of CASA, said Montgomery and Prince George’s could be critical backstops in the event that the statewide Trust Act is defeated. The bill has 78 of 141 delegates and 24 of 47 senators signed on as co-sponsors — short of the 85 House members and 29 senators needed to override a veto by Gov. Larry Hogan (R).

As of last week, no politician in either jurisdiction had embraced the idea. Through a spokeswoman, Torres said that the organization’s energy is focused on Annapolis but that lobbying for local bills remains an option. Howard County lawmakers passed their own immigrant-protection bill, but it was vetoed by County Executive Allan H. Kittleman (R).

In Virginia, Gov. Terry McAuliffe (D) has vowed to veto a set of ICE-friendly bills passed by the commonwealth’s Republican-controlled legislature. About 25 states across the country are considering legislation to bar designation of cities and counties as “sanctuary” jurisdictions; Maryland, seven other states and the District have measures under consideration that would support sanctuary localities.

In a memo to Montgomery County Council members, County Attorney Marc Hansen said several provisions of the Maryland Trust Act are “inconsistent with current County policy,” while others are unclear.

The bill would bar police from assisting ICE if enforcement actions turn violent, a provision “at odds with MCPD’s mission of maintaining public safety,” Hansen wrote.

The Ramirez bill also would preclude counties from reporting virtually any information to ICE, including fingerprints, or responding to agency notifications, according to Hansen’s analysis.

Montgomery police operate under a 2009 directive that bars officers from conducting “indiscriminate questioning” of suspects, witnesses or prisoners about immigration status. Once in custody, all prisoners are fingerprinted, and arrest information goes into state databases, where it is available to ICE. If the agency identifies an undocumented prisoner, it can send the county a “detainer” notice, asking that the person remain in custody for at least 48 hours beyond the scheduled release date.

The county complied with detainers until 2014, when the Maryland attorney general’s office issued an opinion advising localities that they could be liable for damages by holding prisoners past their release date.

Since then, Montgomery officials said, the county honors detainers only if they are supported by a federal court order or warrant. It will also provide ICE publicly available release dates of undocumented immigrants who have committed felonies and whom the agency is seeking to deport.

The state bill would bar cooperation with a broad range of federal programs or initiatives that require information about race, gender or immigration status. These include affirmative action, Equal Employment Opportunity Commission actions or certain settlement agreements with the Justice Department. Hansen said the bill conflicts with state laws requiring that prisoner-release dates be posted in sex-offender and victim-notification registries.

All of which seems too risky for at least some council members, including President Roger Berliner (D-Potomac-Bethesda), who said he and his colleagues will push hard for amendments. “We want to take a stand, albeit a responsible stand,” he said.

Council member Nancy Navarro (D-Mid-County) said she, too, hopes the bill can be moderated. But even if it is not, she will be backing it. “Leaders have to decide if they will be on the right side of history,” she said.