A judge on Friday declared a law the Trump administration has relied heavily on in many of its lawsuits against so-called sanctuary cities as unconstitutional.

In a 58-page opinion, Judge Harry Leinenweber rebuked Attorney General Jeff Sessions Jefferson (Jeff) Beauregard SessionsRoy Moore sues Alabama over COVID-19 restrictions GOP set to release controversial Biden report Trump's policies on refugees are as simple as ABCs MORE and the Trump administration’s efforts taken to penalize sanctuary cities, CNN reported.

Leinenweber moved to strike down the underlying law, known as Section 1373, which mandates that local governments share the immigration status of individuals with the federal government.

ADVERTISEMENT

The ruling from Leinenweber, an appointee of former President Reagan, currently only applies to Chicago, though the judge reportedly said he intends for the ruling to be applied across the country.

Leinenweber previously issued a ruling temporarily blocking immigration-related conditions that the administration had imposed on federal law enforcement grants in an effort to penalize sanctuary cities, a ruling an appellate court upheld.

The judge has now made his initial ruling on the grant conditions permanent and is taking aim at the underlying law the administration has depended on in its sanctuary city lawsuits, CNN reported.

Leinenweber cited a recent Supreme Court ruling legalizing state gambling laws in his opinion Friday as justification for declaring as unconstitutional the underlying law used in the sanctuary city legal battles.

The Supreme Court ruling in question found that the federal government could not prohibit states from passing laws they choose, which Leinenweber also noted in his opinion arrived between the time he had considered the case preliminarily and now.