Lawmakers in California on Saturday passed “sanctuary state” legislation even as President Trump and his administration have vowed to crack down on jurisdictions that do not cooperate with federal immigration agents.

The bill approved early Saturday limits police cooperation with federal immigration authorities and is intended to bolster protections for illegal immigrants in the state.

But the acting director of the U.S. Immigration and Customs Enforcement on Saturday warned of “tragic consequences,” saying the policy “will make California communities less safe.”

“By passing this bill, California politicians have chosen to prioritize politics over public safety,” Thomas Homan, the acting director of ICE, said in a statement. “Disturbingly, the legislation serves to codify a dangerous policy that deliberately obstructs our country’s immigration laws and shelters serious criminal alien offenders.”

Homan said ICE wants to work with local law enforcement to prevent “dangerous criminal aliens” from being released back onto the streets.

The legislation will now be considered by Democratic Gov. Jerry Brown, who announced his support after the top state Senate leader agreed to water down the bill and preserve authority for jail and prison officials to cooperate with immigration officers in many cases.

The bill that passed Saturday prohibits law enforcement officials from asking about a person's immigration status or participating in immigration enforcement efforts.

SANCTUARY CITIES: WHAT ARE THEY?

It also prohibits law enforcement officials from being deputized as immigration agents or arresting people on civil immigration warrants.

The legislation follows Trump’s vow to crack down on sanctuary cities. Such policies limit just how much local law enforcement officials cooperate with federal immigration authorities.

The debate about sanctuary cities intensified in July 2015 when Katie Steinle, 32, was killed as she strolled along the San Francisco waterfront with her father. Steinle was fatally shot by a man with a criminal record who had slipped into the U.S. multiple times illegally.

On Friday, a federal judge in Chicago has ruled Attorney General Jeff Sessions can't withhold public grant money from so-called sanctuary cities for refusing to follow federal immigration policies.

U.S. District Judge Harry Leinenweber made the ruling Friday, in which he granted Chicago's request for a temporary "nationwide" injunction.

The ruling means the Justice Department cannot deny grant money requests until Chicago's lawsuit against the agency is concluded. Leinenweber wrote that Chicago has shown a "likelihood of success" in its arguments that Sessions overstepped his authority with the requirements.

JEFF SESSIONS CAN’T WITHOLD GRANT MONEY FROM SANCTUARY CITIES, JUDGE RULES

The city of Chicago sued the Trump administration in August after it threatened to withhold funds from sanctuary cities, and refused to comply with the Justice Department's demand that it allow immigration agents access to local jails and notify agents when someone in the U.S. is about to be released from custody.

At least seven cities and counties, including Seattle and San Francisco, have refused to cooperate with new federal rules regarding sanctuary cities.

The Associated Press contributed to this report.