California Gov. Jerry Brown on Thursday signed a so-called “sanctuary state” bill that will limit cooperation between local officials and federal immigration enforcement. The measure is one of the most high-profile ways that Democrats in the state have sought to push back against the Republican agenda, as President Donald Trump has taken a hard line on immigration and other issues that are significant to Golden State lawmakers.

“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,” Brown said in statement, according to the Associated Press.

Brown’s decision to sign the bill will almost certainly draw the ire of the President, who has threatened to withhold funds from sanctuary cities — a move that inspired several jurisdictions in California to sue his administration. Though there is not a set definition of what makes any place a “sanctuary” for immigrants, laws described that typically aim to limit the deportation of undocumented residents.

While other states have passed laws that shore up protections for immigrants, the California bill, formally known as SB54, has been described as the most comprehensive in the country. Measures range from treating schools, courthouses and hospitals as “safe zones” to restricting the ability of local police to detain people on behalf of federal immigration agents. The law does nothing to curtail the ability of federal agents to come into the state and deport people or carry out raids, but it does make such actions more difficult for agencies with limited resources.

An estimated 10 million immigrants live in California, more than the entire population of states such as Michigan, and about 25% of them are thought to be undocumented. The author of the bill, state Senate Leader Kevin de Leon, has positioned it as a safety measure to ensure undocumented residents are unafraid to report crimes to the police or send their kids to school. De Leon said at a press conference that the new law “will put a large kink in Trump’s perverse and inhumane deportation machine,” according to the AP.

The main criticisms of SB54 have also been about safety, as organizations such as the California State Sheriffs’ Association have argued that dangerous criminals might slip through the cracks if local authorities are limited in their ability to interact with federal officials. Before signing the bill, Gov. Brown negotiated changes meant to assuage some of those concerns, such as allowing for cooperation in cases that involve particular crimes.

Though Trump could attempt to deny federal funding to California over the bill, he would face legal hurdles in doing so and such an action would very likely lead to a lawsuit. As the new President took office, lawmakers in the state retained former Attorney General Eric Holder’s law firm to help advise them on the legal limits of resistance. And the state has already sued the federal government over issues ranging from energy efficiency standards to the decision to end DACA, a program that has shielded young immigrants from deportation.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Katy Steinmetz at katy.steinmetz@time.com.