SACRAMENTO – The California Senate on Monday approved a closely-watched bill to shield undocumented immigrants from deportation by limiting cooperation between local law enforcement and federal immigration agents.

The controversial proposal — a direct response to President Donald Trump’s promised crackdown on illegal immigration — inspired a lengthy and impassioned debate in the Senate before it passed on a party-line vote, 27-12. It now moves to the state Assembly.

“It is a rejection of President Trump’s false and cynical portrayal of undocumented immigrants as a lawless community,” said Senate leader Kevin de León, who is carrying Senate Bill 54, in a celebratory news conference after the vote.

Proponents like de León argue that separating local police work from federal immigration enforcement will enhance public safety by encouraging victims and witnesses to come forward — and will ease an overwhelming anxiety that has taken hold in immigrant communities since Trump’s election. Opponents counter that it will undermine the rule of law by shielding criminals from deportation. They also say it will put federal funding at risk across the state, as the Trump administration has said it will try to withhold some federal grant money from so-called “sanctuary cities.”

“I can’t believe any of us really want these individuals to stay in our country after committing these heinous crimes,” said Sen. Patricia Bates, the recently elected Senate Republican leader from Laguna Niguel.

The Bay Area has a number of sanctuary counties, including San Francisco, Santa Cruz and Alameda, as well as cities such as Oakland and San Jose. Santa Clara County filed a lawsuit in February challenging the constitutionality of withholding federal funds in response to an earlier threat from the Trump administration, which U.S. Attorney General Jeff Sessions repeated late last month. The lawsuit has since been joined by dozens of cities and counties.

SB 54 would apply a set of sanctuary policies statewide. It would block law enforcement from using state resources to inquire about a person’s immigration status, for example — or from telling federal agents about a person’s release date unless it is public information, with the exception of certain crimes.

Related Articles Democrats to investigate claims of forced hysterectomies on immigrants at Georgia detention center

Ninth Circuit: Trump can end TPS protective status of 300,000 immigrants

Judges: Trump can’t exclude people from district drawings

Opinion: Christians must fight Trump attempt to monopolize faith

H-1B: Trump administration pushes ahead on long-promised changes to controversial visa Sen. Joel Anderson, a Republican from San Diego County who has been a vocal critic of the proposal, brought 30,000 signatures from people opposed to the bill.

“Don’t get caught up with the ‘I-hate-Trump fever,'” he implored his colleagues.

De León recently amended the bill to exempt serious felonies and other “serious” crimes, such as murder and rape. He also dropped his goal of passing it as an “urgency bill” to take effect immediately after being signed into law — which would have required a two-thirds vote of each house. It now only needs a simple majority vote to pass, though it did win two-thirds approval in the Senate on Monday.

If the Assembly passes the bill and Gov. Jerry Brown signs it into law, it wouldn’t take effect until Jan.1.

Asked how he felt Trump would react, de León said, “Will he strike back at us? I don’t know.”