The “sanctuary state” bill — a far-reaching proposal aimed at preventing California law enforcement officers from helping to carry out President Donald Trump’s promised crackdown on illegal immigration — has been signed into law by Gov. Jerry Brown, along with 10 other measures to protect undocumented immigrants.

“This action protects public safety and ensures hard-working people who contribute to our state are respected,” Brown said in a statement Thursday. The law takes effect Jan.1.

To many, Senate Bill 54 was the centerpiece of California’s anti-Trump resistance on immigration. It was introduced on the first day of the legislative session in December — just weeks after Trump’s election — and passed in the session’s final hours.

Pushed by immigration and civil rights groups, it was fiercely fought by the powerful state sheriff’s association. In Southern California, county sheriffs were divided on whether the new law will make it harder to fight crime.

The bill will restrict communications between California police officers and federal immigration agents about people in police custody or in jail awaiting trial, with the exception of those who have been convicted of certain crimes within the past 15 years.

A coalition of civil rights groups that advocated for SB 54 applauded its passage.

“As we celebrate today’s signature, we honor the immigrant community members who bravely stood up and spoke out against painful deportations – and defended the principle that all people should be treated fairly, no matter what they look like or where they were born,” said the group.

Brown negotiated changes to the bill with its author, Senate President Pro Tem Kevin de León, D-Los Angeles, including an expansion of exceptions to the restrictions. The changes neutralized the opposition of the statewide police chiefs, but many sheriffs — who oversee the state’s jails — remained opposed.

California State Sheriffs’ Association President Bill Brown called the new law “problematic.”

“We will continue to work to address the bill’s liabilities, which include restricting our communications with federal law enforcement about the release of wanted, undocumented criminals from our jails,” Brown said.

Orange County Sheriff Sandra Hutchens said in a statement that the bill would end her county’s unique partnership with U.S. Immigration and Customs Enforcement in questioning inmates about their legal status. Orange County is the only one in the state participating in a federal program that allowed sheriff deputies to act legally as ICE agents inside the jails, an arrangement known as a 287(g) contract.

Under the agreement, deputies have been allowed to question people they suspect might be undocumented about their legal status. The information is used in targeting certain individuals for deportation. The agreement also requires deputies to share arrest data, documents and supporting evidence if ICE asks for it.

“Approval of SB 54 presents California with a significant challenge. Restrictions on our ability to communicate with federal authorities will hinder current collaborative efforts to remove serious offenders from our community,” Hutchens said. “This law is inconsistent with widely accepted best practices of open communication amongst all levels of law enforcement. Unfortunately, as a sheriff I must comply with the state’s new law.”

Hutchens said she and ICE would work together on developing “new protocols” to allow them to keep “serious offenders” off the streets while staying within the limits of the sanctuary law.

Los Angeles County Sheriff Jim McDonnell initially opposed the bill, but was assuaged by changes that he said protected the relationship between federal and local law enforcement.

“While not perfect, SB 54 kept intact our ability to maintain partnerships with federal law enforcement officials who help us in the fight against gangs, drugs and human trafficking,” McDonnell said in a statement. “It also retains the controlled access that the United States Immigration and Customs Enforcement has to our jails.”

He added, “These are challenging times for progressive counties such as Los Angeles to maintain civil dialogue around difficult issues. However, the LASD largely accomplished this mission.”

Other bills Brown signed include measures to protect undocumented immigrants from landlord discrimination, workplace raids and block the expansion of immigration detention centers.

Senate Bill 29, by Sen. Ricardo Lara, D-Bell Gardens, places a moratorium on new or renewed leases between local governments and for-profit immigration detention centers.

“California should not be siding with companies that profit from the detention of asylum seekers and the misery of divided families,” Lara said in a statement Thursday. “Senate Bill 29 will stop the runaway train of detention and shine a light on private companies so California can ensure the human rights and dignity of those immigrants detained in our state.”

The Orange County Sheriff’s Department has a $29 million-a-year federal contract to house immigrant detainees in the county jail.

Undersheriff Don Barnes said the new law would prevent the county from expanding the number of beds in the agreement, but the county would still be able to renew the contract.

Barnes said that housing undocumented detainees in Orange County is actually a benefit to immigrant families. He explained that otherwise the detainees would be housed in Northern California, Arizona or Texas, away from their families.

“Even if they are released into the public, ICE will still come looking for them and if they come into contact with other (undocumented) immigrants, they will take them along with them,” Barnes said.

Here is a sampling of the immigration bills signed into law:

‘Sanctuary state’: Senate Bill 54, by Senate Leader Kevin de León, D-Los Angeles, aims to prevent local law enforcement officers from assisting with a promised crackdown on illegal immigration by restricting communication between local officers and federal agents about people in custody, with the exception of those convicted of most felonies within the past 15 years.

Landlords and housing: Assembly Bill 291, by Assemblyman David Chiu, D-San Francisco, will make it illegal for landlords to use someone’s real or perceived immigration status against them. Assembly Bill 299, by Assemblyman Ian Calderon, D-Whittier, would bar public entities from seeking information from property managers about a tenant’s immigration status.

Workplace raids: Another bill by Chiu, Assembly Bill 450, was carried in anticipation of stepped-up workplace immigration raids and would require an employer to require proper court documents before allowing immigration agents access to the workplace or to employee information.

‘Dreamer’ and student protections: Assembly Bill 699 by Assemblyman Patrick O’Donnell, D-Long Beach, prevents schools from collecting information about the immigration status of students or their families and requires school officials to report requests for information or access to a school from immigration authorities to the governing board, among other measures. As soon as President Trump announced he would be phasing out the Deferred Action for Childhood Arrivals program, which grants work permits to young people brought into the country illegally as children (many of whom refer to themselves as “Dreamers”), lawmakers issued a number of bills, including Assembly Bill 21, by Assemblyman Ash Kalra, D-San Jose. It will require CSU and community colleges to expand protections for college DACA students and their families.

Tony Saavedra is an investigative reporter specializing in legal affairs for the Orange County Register. His work has been recognized by the National Headliner Club, the Associated Press Sports Editors, the California Newspaper Publishers Association, the Orange County Trial Lawyers Association and the Orange County Press Club. His stories have led to the closure of a chain of badly-run group homes, the end of a state program that placed criminals in inappropriate public jobs and the creation of a civilian oversight office for the Orange County Sheriff's Department, among other things. Saavedra has covered the Los Angeles riots, the O.J. Simpson case, the downfall of Orange County Sheriff-turned felon Michael S. Carona and the use of unauthorized drugs by Olympian Carl Lewis. Saavedra has worked as a journalist since 1979 and has held positions at several Southern California newspapers before arriving at the Orange County Register in 1990. He graduated from California State University, Fullerton, in 1981 with a bachelor of arts in communication.