Gov. Bruce Rauner signed a law Monday designed to protect Illinois’ half-million undocumented immigrants from deportation, drawing criticism from the administration of a fellow Republican: President Donald Trump.

The bill, dubbed the TRUST Act, restricts local law enforcement from collaborating with federal immigration agents to detain anyone unless the feds have a warrant.

Activists working with the Illinois Coalition for Immigrant and Refugee Rights praised the legislation as a shield for undocumented residents who could otherwise face deportation through any simple interaction with police, including traffic violations.

But Trump’s administration, namely the Justice Department headed by Attorney General Jeff Sessions, came out swinging against the new law.

“As the Attorney General has said, when cities and states refuse to help enforce immigration laws, our nation is less safe,” DOJ spokesman Devin O’Malley told Fox News. “Failure to deport aliens who are convicted for criminal offenses puts whole communities at risk — especially immigrant communities in the very sanctuary jurisdictions that seek to protect the perpetrators.”

 Gallery

The Trump administration’s anti-immigration rights stance didn’t faze Rauner a bit when he signed the TRUST Act amid cheers at a crowded restaurant in the Little Village neighborhood after greeting the crowd in Spanish with a hearty: “Buenos dias.”

Rauner said the bill should also serve to reassure undocumented immigrants that reporting a crime to police will not result in deportation, as well as free up cops to deal with more serious crimes.

RELATED: Sessions bashes Rahm over sanctuary cities issue
RAHM: Trump administration trying to blackmail sanctuary cities

First to speak at the bill signing news conference were law enforcement officials.

“All people in the state of Illinois should feel secure and have the ability to reach out to any of us in law enforcement … to report crimes and call for assistance,” Illinois State Police Director Leo Schmitz said.

Lake County Sheriff’s Office Sgt. Chris Covelli said it was important to note that the new law “does not make Illinois a sanctuary state” and Lake County will continue to cooperate with federal authorities who seek custody of undocumented immigrants who end up in the county jail.

But Republican State Rep. John Cabello, who represents the Rockford area, fears the federal government won’t see it like that. “Now Illinois is at risk of losing federal funding because it will be perceived that we are going to be a sanctuary state,” Cabello, an opponent of the bill, said Monday.

Also Monday, Rauner signed a law that will establish a system in Illinois to automatically register eligible voters whenever they apply for, update, or renew a driver’s license or state ID.

The bill, which received wife bipartisan support, will put in place the farthest-reaching automatic voter registration law in the country.

Illinois will be the 10th state, and first in the Midwest, to enact automatic voter registration.