Montgomery County is set to hire the former director of immigration for the Department of Homeland Security as special counsel to help officials sort through the legal and political challenges posed by the Trump administration’s immigration policies.

Leon Rodriguez also served as Montgomery County attorney from 2007 to 2010. Most recently he was director of the U.S. Citizenship and Immigration Services for the Obama administration. The 18,000-person agency is charged with administering all immigration policies, including visa and asylum applications, the vetting of refugees and the granting of U.S. ­citizenship.

Rodriguez's appointment, which is expected to be approved Tuesday by the Montgomery County Council, underscores the level of uncertainty faced by local officials in liberal jurisdictions in light of President Trump's declared intention to arrest and deport large numbers of undocumented immigrants.

Localities such as Montgomery are struggling to maintain the trust of large foreign-born populations in school systems and other institutions while trying to avoid being targeted for federal enforcement.

The tumult has thrust local government attorneys onto the unfamiliar terrain of federal immigration law. In Arlington County, the public school system recently retained the D.C.-based Hogan Lovells law firm to provide advice as needed with immigration matters.

The Rockville City Council held a public hearing Monday evening on a proposal to adopt limits on the cooperation that police, corrections personnel and other city employees can extend to immigration authorities. The Howard County Council voted 3 to 2 to uphold County Executive Allan H. Kittleman’s veto of a similar measure. The fourth yes vote was required to reverse the veto.

In Montgomery, County Attorney Marc Hansen found himself scrambling last week to craft amendments ordered by the County Council in response to the Maryland Trust Act, which is before the General Assembly.

The bill would impose more sweeping restrictions on cooperation with federal authorities than what is the practice in Montgomery. County officials would like to push the bill closer to its more moderate policies.

As county officials continue to navigate such issues, Hansen said, Rodriguez’s unusual background in both county and federal immigration law made him particularly qualified to play a role.

“The immigration landscape seems to be very fluid,” Hansen said. “It’s very unclear what, if any, significant changes may be made by the federal government. Montgomery clearly has a stake in how these laws are implemented.”

Rodriguez, 54, is a partner in the D.C. office of the law firm Seyfarth Shaw. He declined to comment Monday.

Hansen said it was not certain how many hours Rodriguez would work. His hourly fee is still under negotiation.

Officials had thought he would help draft amicus briefs the county was planning to file in support of lawsuits brought by the New York and Washington states challenging Trump’s January executive order banning travelers from seven ­majority-Muslim countries.

But Hansen said that those plans are uncertain in light of the revised executive order that Trump issued Monday. For the most part, Hansen said, the decision to retain Rodriguez is more of a protective move than a response to any immediate need.

Local supporters of Trump’s immigration policies expressed skepticism Monday about the county’s need for legal advice.

“I guess my first reaction is that it’s awful easy to spend other people’s money,” said Montgomery County Republican Party Chairman Dick Jurgena. “Unless you’re going to defy immigration law, it doesn’t seem to be a real complicated issue.”

Rodriguez is the grandson of Jewish refugees who came to Cuba to escape anti-Semitism in Europe. His parents emigrated from Havana to Miami’s Cuban enclave in 1961. He has told interviewers that his family’s story leaves him with a deep understanding of the desperation many immigrants feel.

"I think about my grandparents; I think about my parents," he told the Jewish newspaper the Forward in 2015. "Nobody comes here because all they want to do is go to the beach."

Patricia Sullivan contributed to this report.