(Reuters) - Maryland’s House of Delegates on Monday approved legislation to bar police statewide from checking the immigration status of individuals they arrest or keeping them locked up longer than otherwise warranted at the request of federal agents seeking to deport them.

The state Senate in Annapolis, which like the lower house of the General Assembly is controlled by Democrats, has yet to consider the bill, and Republican Governor Larry Hogan issued a statement vowing to veto the measure if it reached his desk.

“This legislation would interfere with our state and local law enforcement’s ability to cooperate with federal law enforcement authorities,” Hogan said.

Supporters say the measure, which cleared the House of Delegates on a largely party-line vote of 83-55, is designed in large part to maintain the trust of immigrant communities in local law enforcement and government agencies.

It would prohibit state and local police officers from stopping, arresting, searching or detaining an individual for purposes of suspected immigration violations.

It would also bar police from honoring administrative “detainer” requests from federal immigration authorities seeking to keep jailed individuals in custody after they should otherwise be released on bond.

Other provisions would require the state attorney general to issue guidelines to public schools, courthouses and hospitals on limiting immigration enforcement in those places. And it would restrict state funds from being used to create a registry of people on the basis of immigration status, nationality, religion or ethnic origin.

The measure follows in the footsteps of dozens of municipalities and local jurisdictions across the country that have declared themselves “sanctuary cities,” including San Francisco, Chicago, Boston, Los Angeles, Philadelphia, Seattle and Washington.

So far no such statewide designations have been enacted.

Republican President Donald Trump in January signed an executive order seeking to withhold federal funds from local governments that limit cooperation with federal immigration authorities.

At the time, he said local jurisdictions put U.S. citizens at risk by releasing criminals who should be deported and who, in some cases, commit additional offenses after being released from jail.