SACRAMENTO (CBSLA/AP) — California Gov. Jerry Brown signed “sanctuary state” legislation Thursday that extends protections for immigrants living in the United States illegally — a move that gives the nation’s most populous state another tool to fight President Donald Trump.

Brown’s signature means that police will be barred from asking people about their immigration status or participating in immigration enforcement activities starting Jan. 1.

READ MORE: Fox, Hield Lead Kings Over Lakers 141-137 In Triple OT

Jail officials only will be allowed to transfer inmates to federal immigration authorities if they have been convicted of certain crimes.

Following sharp dissent from law enforcement officials — including Los Angeles County Sheriff Jim McDonnell — it was scaled back significantly. McDonnell praised the revised bill as “very different.” Back in March, McDonnell had said he feared SB5 54 would force Immigration and Customs Enforcement (ICE) agents into the communities.

“The potential is, the likelihood is, they’re going to go into the communities looking for the individual, and my assessment would be they’re not going to limit themselves to that individual,” McDonnell said at the time.

California is home to an estimated 2.3 million illegal immigrants.

Latest Coverage: The Sanctuary Debate

Last month, a federal judge in Chicago ruled that Attorney General Jeff Sessions cannot follow through with his threat to withhold public safety grant money to so-called sanctuary cities for refusing his order to impose tough immigration policies.

Sanctuary cities in the Southland include San Bernardino, Santa Ana and Malibu. In early August, Sessions moved to punish San Bernardino and three other so-called sanctuary cities, threatening to deny them federal crime-fighting resources if they don’t step up efforts to help detain and deport people living in the country illegally.

READ MORE: LAPD Releases Video Of Officer Using Taser Gun On Man With Sword

In an appearance last month in San Diego, Sessions was critical of the bill.

“One of the sad things is we have this disagreement over sanctuary cities and sanctuary states,” Sessions said on Sept. 20. “And the refusal of certain jurisdictions to cooperate with our colleagues, mostly our ICE agents, who have the responsibility under the law, the duty to arrest people who are in the country illegally, who commit, in addition to that, crimes against the United States of America, who are due to be deported. And I find it almost unbelievable that states and cities would object to that?”

Oregon is the only other state that has declared itself a sanctuary, doing so in 1987.

The measure came in response to widespread fear in immigrant communities following Trump’s election. He railed against immigrants in his campaign and promised to sharply ramp up the deportation of people living in the U.S. illegally.

Democrats hope blocking police from cooperating will limit the reach of U.S. Immigration and Customs Enforcement officers.

The measure introduced by the Democratic Senate leader, President Pro Tem Kevin de Leon of Los Angeles, cleared the Legislature with support only from Democrats. Republicans said it will protect criminals and make it harder for law enforcement to keep people safe.

Under SB54, police and sheriff’s officials, including jail officers, will still be able to work with federal immigration authorities if a person has been convicted of one of about 800 crimes, mostly felonies and misdemeanors that can be charged as felonies. But they will be barred from transferring immigrants to federal authorities if their rap sheet includes only minor offenses.

ICE Acting Director Thomas Homan has condemned the measure, saying California is prioritizing politics over public safety.

MORE NEWS: Black Friday: Another High-End Store Is Robbed, Prompting LAPD To Issue City-Wide Tactical Alert

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)