California has adopted the most expansive “sanctuary state” law in the US with the goal of obstructing Donald Trump’s deportation agenda by prohibiting police in the country’s most populous state from cooperating with federal immigration authorities.

'Sanctuary schools' across America defy Trump's immigration crackdown Read more

The landmark bill, signed into law on Thursday, restricts police from questioning people about their citizenship status and detaining foreign-born residents on immigration violations. The law, which also prohibits police from transferring certain inmates to immigration authorities, could lead to a major legal showdown between the White House and California and is the latest example of the liberal Golden State creating roadblocks to Trump policies.

The legislation is more far-reaching than an existing sanctuary state policy in Oregon and could help shield immigrants from aggressive deportation efforts in a state home to more than two million undocumented people, nearly a quarter of all unauthorized immigrants living in the US.

The California Values Act builds on the sanctuary city policies that Trump aggressively targeted during his 2016 campaign and which exist in hundreds of municipalities. Studies have challenged Trump’s claims that sanctuary jurisdictions attract crime; some research suggests cities with sanctuary policies have significantly lower crime rates than comparable municipalities that allow local police to enforce immigration laws.

Some liberal cities, such as San Francisco, have sued the Trump administration over his threats to withhold federal public safety grant money as a punishment. Those cities have argued that when police stay out of immigration enforcement, undocumented people are more likely to report crimes and work with police.

Even before California’s governor, Jerry Brown, signed the new law, the bill was the subject of widespread attacks by the Trump administration and conservatives across the country. The US attorney general, Jeff Sessions, recently called the bill “unconscionable” and said it “risks the safety of good law enforcement officers and the safety of the neighborhoods that need their protection the most”.

In California, a state controlled by Democrats, the proposal has faced significant pushback from some conservative sheriffs. Brown, a Democrat, recently negotiated revisions with sponsoring senator Kevin de León that loosened restrictions on police, giving them discretion to hold certain people for federal authorities if they have been convicted of serious or violent felonies.

Brown said: “These are uncertain times for undocumented Californians and their families, and this bill strikes a balance that will protect public safety, while bringing a measure of comfort to those families who are now living in fear every day.”

Though the bill is watered down from its original version, which created stricter boundaries on police, some right-leaning law enforcement officials have continued to vocally oppose the measure. Thomas Homan, acting director of Immigration and Customs Enforcement (Ice), said in a statement that California had “chosen to prioritize politics over public safety”. De León said the state is preparing to defend the legislation in court if Trump’s administration takes legal action.

It is unclear what kind of opposition the law could face in California. Sheriff Bill Brown of Santa Barbara County, president of the California State Sheriffs’ Association, which opposes the law, said: “We’re sworn to uphold the law. I don’t know of any sheriff in the state who is not going to adhere to this.”

John McGinness, a consultant with the California Peace Officers’ Association, which also opposes the law, said there was a “high level of frustration” among officers. “I hope they remember their obligation to comply with the law, and I hope they will, but I understand there might be some thinking, ‘I want to do the right thing’, and resistance could be a part of that.”

Even in liberal California counties that already have sanctuary rules on the books, local police have faced criticism from immigration advocates for continuing to work with Ice.

After the law’s passage, Jennie Pasquarella, immigrants’ rights director for the ACLU of California, said in a statement that the law would “lift the bar statewide to safeguard Californians’ due process rights, particularly in those jurisdictions that have proven to be active, even enthusiastic, participants in the Trump mass deportation agenda”.