SAN FRANCISCO - JANUARY 27:  The San Francisco skyline is seen behind the north tower of the Golden Gate Bridge January 27, 2005 in San Francisco. A controversial film made by moviemaker Eric Steel documenting people committing suicide off of the Golden Gate Bridge has opened a debate about why there isn't a suicide barrier on the famous landmark. Over 1,300 people have jumped to their death from the span since the bridge opened in 1937. (Photo by Justin Sullivan/Getty Images)
Justin Sullivan/Getty Images North America/Getty Images
SAN FRANCISCO - JANUARY 27: The San Francisco skyline is seen behind the north tower of the Golden Gate Bridge January 27, 2005 in San Francisco. A controversial film made by moviemaker Eric Steel documenting people committing suicide off of the Golden Gate Bridge has opened a debate about why there isn't a suicide barrier on the famous landmark. Over 1,300 people have jumped to their death from the span since the bridge opened in 1937. (Photo by Justin Sullivan/Getty Images)
Now playing
01:39
Sanctuary cities: What you need to know
ice explainer van jones vpx_00014806.jpg
ice explainer van jones vpx_00014806.jpg
Now playing
01:49
Why Democrats call for ICE to be abolished
 Yazmin Juarez and Marlee.
Arnold & Porter
Yazmin Juarez and Marlee.
Now playing
01:59
Child dies weeks after ICE custody
Maria Venegas
Now playing
02:36
ICE agents detain man driving wife to hospital
CNN
Now playing
01:39
Tlaib: We had border security before ICE
mother daughter reunited 62 days orig js_00003102.jpg
mother daughter reunited 62 days orig js_00003102.jpg
Now playing
01:13
Mother and daughter reunited after 61 days
WCVB
Now playing
00:58
Elizabeth Warren: US immigration a moral crisis
CNN
Now playing
01:45
Immigration attorney represented 3-year-old
CNN
Now playing
01:34
Lawmaker arrested during Trump protest
CNN
Now playing
01:24
Senator: US is encouraging illegal immigration
CNN
Now playing
01:44
Protesters block bus at immigration site
CNN
Now playing
01:55
Rep. Speier: I saw children crying in cells
US President Donald Trump walks to board Marine One as he departs for North Dakota at the White House in Washington, DC, on June 27, 2018.
NICHOLAS KAMM/AFP/Getty Images
US President Donald Trump walks to board Marine One as he departs for North Dakota at the White House in Washington, DC, on June 27, 2018.
Now playing
01:59
Trump blasts movement calling to abolish ICE
Secretary of State Mike Pompeo listens as President Donald Trump speaks during a cabinet meeting at the White House, Thursday, June 21, 2018, in Washington. (AP Photo/Evan Vucci)
Evan Vucci/AP
Secretary of State Mike Pompeo listens as President Donald Trump speaks during a cabinet meeting at the White House, Thursday, June 21, 2018, in Washington. (AP Photo/Evan Vucci)
Now playing
01:36
Trump: GOP should stop wasting time on immigration
Immigrant children walk in a line outside the Homestead Temporary Shelter for Unaccompanied Children, a former Job Corps site that now houses them, on Wednesday, June 20, 2018, in Homestead, Fla. (AP Photo/Brynn Anderson)
Brynn Anderson/AP
Immigrant children walk in a line outside the Homestead Temporary Shelter for Unaccompanied Children, a former Job Corps site that now houses them, on Wednesday, June 20, 2018, in Homestead, Fla. (AP Photo/Brynn Anderson)
Now playing
01:54
Children in limbo after Trump executive order
CNN
Now playing
02:08
Why immigrants make dangerous journey to US
(CNN) —  

Attorney General Jeff Sessions and the Trump administration were handed another stark defeat in their effort to punish sanctuary cities, with a judge declaring a law the administration had been relying on unconstitutional.

In a terse 58-page opinion, a Reagan-nominated district court judge thoroughly rebuked Sessions’ efforts to penalize sanctuary cities, saying efforts he has taken to impose immigration-related conditions on federal law enforcement grants are unconstitutional. The judge also called the underlying law that the administration has pointed to as justifying its efforts unconstitutional.

The ruling will only apply to the city of Chicago for now – but the judge said he intends for his ruling to apply nationwide.

Judge Harry Leinenweber had also previously temporarily blocked the grant conditions, which the appellate court upheld.

But now Leinenweber has gone even further — making his initial ruling permanent and going beyond it to strike down the underlying law, referred to as Section 1373.

The administration has pointed to the obscure law in all of its sanctuary city lawsuits, the vast majority of which it has lost. The law mandates that local governments share immigration status of individuals with the federal government.

The Justice Department has argued that law should be interpreted broadly to mandate cooperation with federal immigration enforcement. But citing a recent Supreme Court ruling, Leinenweber did the opposite – striking down the law itself as unconstitutional.

Like a Philadelphia judge before him, Leinenweber has found that the Supreme Court’s recent ruling legalizing state gambling laws also applies here. The Supreme Court found in May that the federal government cannot prohibit states from passing laws they choose, in that case, legalizing gambling.

Leinenweber noted that ruling came between when he had first considered the case preliminarily and now, and based on that precedent, Section 1373 is also unconstitutional.

The Philadelphia ruling only applied to that city. For now, so will Friday’s ruling. But Leinenweber was clear that he intends the ruling to apply nationwide. The full appellate court is currently considering whether his earlier ruling should apply nationwide, and he temporarily kept his ruling limited to Chicago in deference to that process.

Once the pause is lifted, the striking down of the underlying law would apply nationwide.

In a statement, Justice Department spokesman Devin O’Malley called the ruling a “victory for criminal aliens,” saying they can “continue to commit crimes in the city” with impunity from immigration enforcement.

“The Justice Department continues to maintain that we exercised our authority, given by Congress, to attach conditions – designed to keep Americans safe – to public safety grants, and we will continue to fight to carry out the Department’s commitment to the rule of law, protecting public safety, and keeping criminal aliens off the streets,” O’Malley said.

In his ruling, Leinenweber noted that “the Attorney General has not mustered any other convincing argument in support of greater statutory authority” since his earlier ruling, and “nothing has shaken this Court from the opinion it expressed at (that) stage.”

Leinenweber also recently accepted similar lawsuits from the state of Illinois and the US Conference of Mayors, setting the stage for him to potentially quickly enter judgments that apply to more jurisdictions than Chicago.

Sanctuary city is a catch-all term used to describe jurisdictions that in some way don’t cooperate with federal immigration enforcement, especially in terms of detaining immigrants for extra time in jail so they can be picked up by federal authorities or allowing federal agents into jails to take custody of immigrants. Federal authorities say the enforcement is necessary to keep communities safe, but many local police chiefs say they have policies against such cooperation in order to preserve local resources and maintain essential trust with immigrant communities and victims of crimes.