CHICAGO: Illinois will limit how local and state police can cooperate with federal immigration authorities under a plan signed into law Monday by Gov. Bruce Rauner, a move that puts the first-term Republican at odds with his party on immigration issues.

The narrow measure prohibits police from searching, arresting or detaining someone solely because of immigration status, or because of so-called federal immigration detainers. But local authorities will be able to communicate with immigration agents and hold someone for federal authorities if there’s a valid criminal warrant, according to the new law.

Rauner acknowledged at the signing — a heavily-attended, festive event in a predominantly Mexican neighborhood — that it was a tough proposal many didn’t want him to support, but he said he was convinced after talking with law enforcement and immigrant leaders.

“This took months and months of difficult negotiations,” Rauner said after a mariachi band performed and celebratory speeches, including from a top Democrat. He said it helps Illinois take another step toward “continuing to be a welcome state.”

Proponents insist the measure falls short of a “sanctuary” law because it leaves the door open to communication and ensures the state complies with federal law. But Republican opponents have tried to characterize it that way, something that comes as President Donald Trump has threatened to crack down on sanctuary cities, which have laws friendly to immigrants living in US without legal permission.

The move places Rauner in a tricky spot as Democrat-heavy Illinois’ first GOP governor in over a decade. He faces re-election next year and will need to shore up support from Republican strongholds outside Chicago.

Rauner said he believed the measure would increase safety and “improve connectivity” between immigrants and law enforcement to make the state safer.

Detainers are requests from US Immigration and Customs Enforcement to law enforcement agencies to hold a suspected deportable immigrant long enough for immigration authorities to pick them up. But federal courts have found the requests aren’t sufficient for local jails to hold someone after bail has been posted or beyond their sentence, with critics raising constitutional and liability questions for jails. California and Connecticut don’t honor them, a practice many counties nationwide already follow.

Trump has called for more links between federal and local authorities to fix a broken immigration system and deport criminals. He’s threatened to withhold public safety funds from sanctuary cities such as Chicago, which has filed a lawsuit in response. In light of his crackdown, Miami-Dade County has reversed a sanctuary policy and Texas beefed up laws to allow police to ask about immigration status on traffic stops and requiring law enforcement to honor detainers or face punishment. However, the Texas law faces a court challenge.

In Illinois the measure was only approved after it was scaled back from an initial proposal that included the creation of “safe zones,” like schools and hospitals where immigration agents wouldn’t be allowed to make arrests.

Law enforcement agents, who attended Monday’s event, said the plan would allow them to focus energy on safety, encourage immigrant victims of crime to come forward and build trust. Tension between the groups was on display briefly during the event as Illinois Sheriff’s Association executive director Greg Sullivan used criminal justice terminology to discuss the “removal of illegal criminal aliens” to the crowd of immigrants and activists. Several interrupted, yelling their preferred term of “undocumented.”

Rauner’s hesitance to back the bill has been obvious. The former businessman has avoided talking about national issues such as immigration, particularly when it comes to Trump. He’s said he favors comprehensive immigration reform, but has not detailed what that means.

This month during his first national television interview on FOX News, he repeatedly declined to discuss Chicago’s lawsuit or sanctuary laws. He pivoted to his ongoing fight over state funding issues with majority Democrats. In response, conservative media outlets such as Breitbart News, blasted Rauner for not denouncing the measure. A Chicago Tribune columnist said Rauner signing the bill “opens a breach on his right political flank.”

Ahead of the signing, Rauner would only say the measure was “reasonable,” prompting groups in support such as the Illinois Business Immigration Coalition, which includes high-profile Republicans and CEOs, to boost advocacy.

Backers say the law, reviewed by State Police and the Illinois Attorney’s General office, will help protect immigrants from federal harassment.

“It’s obviously a benefit to an undocumented person to know the police are not going to be putting them under suspicion everywhere they go,” Senate President John Cullerton, a Democratic sponsor of the bill said at the signing. “There are also benefits to law enforcement.”

The law takes effect immediately.