President Donald Trump’s crackdown on undocumented immigrants has some sheriffs worried the White House is pushing them to break the law – demanding they violate the Fourth Amendment or face vilification from the commander-in-chief.

“It’s a total mess,” said Bob Gualtieri, the sheriff of Pinellas County, Fla.

At issue is a complicated question: Should sheriffs keep undocumented immigrants in their jails for more time than otherwise necessary so that Immigration and Customs Enforcement (ICE) officers can pick them up to be deported?

The White House is demanding sheriffs do just that, by honoring ICE’s requests that sheriffs keep certain people locked up long enough for the agency to take them into custody. Those requests are called detainers. And many sheriffs would happily comply – except that federal courts have ruled repeatedly that the Fourth Amendment bars them from keeping an undocumented immigrant in jail who would otherwise go free.

“If we violate the law by doing what they ask us to do, we’re subjecting ourselves, no question, to civil liability and civil rights violations,” Gualtieri said.

He added that he spoke about the issue recently with Stephen Miller – a top White House advisor working on immigration – who didn’t seem to understand his Constitutional concerns.

“My takeaway from that conversation with Stephen Miller is that he was uninformed about this problem,” Gualtieri said. “I think that there are certain admin officials who think that these warrants [detainers] solve the problem, and are saying, ‘What are you sheriffs doing? Why aren’t you cooperating?’ when they don’t know that it is clearly a problem and that we can’t do it.”

“I give them the absolute benefit of the doubt,” Gualtieri added. “I think that they’re uninformed on the problem.”

A White House spokesperson directed The Daily Beast to ICE for comment on this story. And ICE spokesperson Liz Johnson said the agency is exploring “a variety of options that address the concerns of our sheriff partners when honoring ICE detainers.”

“A variety of options are under review,” she said in a statement, “but no final decisions or formal plans have been submitted for action at this time.”

“The agency maintains that detainers are legally-authorized requests, upon which a law enforcement agency may rely, to continue to maintain custody of an alien for up to 48 hours so that ICE may safely assume custody for removal purposes,” she added.

Sheriff Richard Stanek, of Hennepin County, Minn., told The Daily Beast that ICE is demanding sheriffs violate the Constitution.

“The current ICE detainer notion that Sheriffs can and should hold alleged illegal aliens beyond the time that their local charges are adjudicated is in violation of their constitutional rights while in the United States of America, and ICE knows this,” he said in a statement provided to The Daily Beast. “The U.S. courts have ruled against this notion time and time again – the way forward for ICE and local Sheriffs in partnership to protect public safety is a solution that both provides for public safety while at the same time protecting an individual’s constitutional rights.”

Most experts estimate that about 40 percent of undocumented immigrants in the U.S. came here legally but then stayed longer than their visas allowed. Overstaying a visa is a civil offense, not a criminal one. When an undocumented immigrant who has overstayed a visa gets arrested for an unrelated offense, ICE will sometimes ask the sheriff to keep that immigrant in custody for longer than necessary so their officers can pick the immigrant up to be deported.

But jailing someone who hasn’t committed a crime violates the Fourth Amendment, according to several federal judges. And when sheriffs do so, immigrants’ rights groups sometimes sue them. For cash-strapped law enforcement offices, these suits can be a real threat. In 2014, an Oregon sheriff’s office paid $100,000 to settle such a lawsuit.

Despite those legal fears, many sheriffs want to help the Trump administration with its deportation efforts. Gualtieri is one of those sheriffs, and he told The Daily Beast he’s found a work-around: His office has signed a contract with ICE to essentially become a temporary ICE detention facility when ICE requests they do so.

The set-up lets Gualtieri hold undocumented immigrants if ICE asks him to. He is heading the National Sheriffs Association’s efforts to resolve the issue. Other sheriffs say they also want to make the same agreement with ICE.

There are two issues, though, according to Gualtieri: The White House doesn’t get it, and the bureaucracy at ICE isn’t moving quickly enough to sign up sheriffs.

“We can’t keep doing it this way,” he told The Daily Beast. “The sheriffs are in the absolute definition of a dilemma because we want to cooperate – we don’t want criminal illegals on the street, we don’t want a Kate Steinle situation, we want people safe – but at the same time, we’re obligated to follow the law.”

Gualtieri has visited Washington multiple times over the last few months and had numerous conversations with administration officials. His goal is to get ICE to sign contracts with the sheriffs who want them, so those sheriffs won’t risk lawsuits by cooperating with the agency.

But working with ICE is taking a long time, despite the White House’s insistence that sheriffs cooperate immediately. And the situation has some sheriffs quite irked.

Sheriff Greg Champagne of St. Charles Parish, La., is on the executive committee of the National Sheriffs Association. Along with Gualtieri, he is working with ICE on the issue. And he said it’s been tough. All he wants, he told The Daily Beast, is to sign an agreement with the agency so he can keep undocumented immigrants in his jail without potentially getting sued. But the ICE bureaucracy is taking forever.

“It just needs to be expedited,” he said. “They need the people to do it, they need the effort to do it. We’re a little frustrated.”