The Trump administration is working with like-minded sheriffs from around the country on a plan to channel undocumented immigrants from local jails into federal detention, according to several sheriffs involved in the discussions. If it succeeds, it could vastly expand the dragnet that has already begun to transform immigration enforcement in the United States.

The plan is intended to circumvent court decisions that have thus far limited the role of local law enforcement in immigration. It involves a legal move regarding detainers, which are requests by Immigration and Customs Enforcement to local sheriffs or police departments to hold people who are suspected of being in the country illegally, even after they have posted bail, finished their jail sentence or otherwise resolved their criminal cases.

A handful of sanctuary cities refuse to honor detainers on ideological grounds, but a larger number of sheriffs who otherwise support the Trump administration have also turned down detainers because courts have found that they violate the Fourth Amendment.

The legal move, in which sheriffs would essentially serve as contractors for ICE, is intended to protect sheriffs from such court battles, which have sometimes resulted in costly payouts. Some legal advocates for immigrants, though, expressed doubt that courts would view it as being different from current practices.