“When a judge says something is in violation of the Fourth Amendment, I am not going to just keep doing it,” said Sheriff William Gore of San Diego. “If they want to take someone into federal custody, they can decide to do that, but I am not going to keep holding somebody because they ask me to, and nothing more than that.”

The decision, said Sheriff Gore, echoing the sentiments of other sheriffs, has nothing to do with his own position on immigration, but rather with the predicament that Washington seems to have left him with. “We need them to figure this out,” he said. “They can’t just rely on us to do it for them.”

The Obama administration expanded the detainer program as a way to strengthen immigration enforcement and create a uniform policy for local police and sheriffs’ departments. Now, the backlash is creating the kind of patchwork system the policy was meant to avoid. Last month, California’s attorney general, Kamala D. Harris, published an advisory memo telling local law enforcement officials that departments that abide by the detainer requests could be vulnerable to lawsuits.

The local changes are likely to increase pressure on President Obama, who is already facing criticism from both sides of the immigration debate. Amid the influx of Central American immigrants along the Texas border, Republicans in Congress are increasingly lashing out against what they see as lax enforcement, even as immigration reform advocates intensify their efforts to persuade the administration to ease deportations. Federal officials request detainers on many noncitizens in jails, including people who have been arrested merely for driving without a license as well as those convicted of serious crimes, such as armed robbery.

Under the program, jails are supposed to send fingerprints of everyone arrested to the Department of Homeland Security, where they can be checked against databases tracking immigration violations, and to hold people in custody while they are investigated.