The legislation would limit the sharing of information by California law enforcement with federal immigration agents. It would also prevent U.S. Immigration and Customs Enforcement agents from working with jails to deport prisoners directly.

Advocates for immigrants say the bill would improve their community's relations with law enforcement.

"SB 54 will give our community a sense of safety in their interaction with local law enforcement," said Angelica Salas with the immigrant-rights group CHIRLA.

The sheriffs argue the bill could endanger the public and protect violent criminals.

McDonnell says if ICE agents can't transfer prisoners from jails the alternative would be worse. They would still look to deport released prisoners, but the wider search would ensnare more people.

"They're still going to do their job," McDonnell said. "Although they can't get in the jail they're going to look for whoever their target is in the community. When they do that they're going to make collateral arrests of people who are not their target but are undocumented."

Several groups filed a lawsuit yesterday against the sheriff to compel disclosure about any interactions with the Trump administration about SB54. They said the department has failed to comply with public records requests for information on the issue.

SB 54 has already passed the state Senate and is set to be taken up by the Assembly later this month.