The U.S. Supreme Court's recent decision allowing states to legalize sports betting makes a federal law that attempts to control state immigration policies unconstitutional, a federal judge said in a decision Friday.

The opinion was part of a larger decision by U.S. District Judge Edgardo Ramos of the Southern District of New York, who said Friday the U.S. Department of Justice could not place immigration-related conditions on so-called “sanctuary jurisdictions” to receive a federal criminal justice grant.

Ramos wrote that the Supreme Court's analysis of the Tenth Amendment in its decision in Murphy v. National Collegiate Athletic Association earlier this year effectively strikes down the constitutionality of a federal law that prohibits state and local governments from restricting officials from sharing information with federal immigration authorities.

“It necessarily follows that [8 U.S. Code Section 1373] is unconstitutional under the anticommandeering principles of the Tenth Amendment,” Ramos wrote. “Section 1373's prohibition on states and localities from restricting their officials from communicating with immigration authorities constitutes a 'direct order' to states and localities in violation of the anticommandeering rule.”

In other words, after the Supreme Court ruled that the federal government could not dictate the legislative power of states to enact sports betting laws, the same interpretation can be applied to a state's immigration policies in this case, Ramos argued.

The decision is a significant victory for sanctuary cities and states that have opted to stop cooperating with federal immigration authorities on information involving undocumented immigrants. A previous appellate decision from the U.S. Court of Appeals for the Second Circuit had a different interpretation of the statute, but Ramos argued that was nullified by the Supreme Court's decision in Murphy.

That litigation also involved New York City, which is a plaintiff in the lawsuit decided Friday. New York City Corporation Counsel Zachary Carter said in a statement they were pleased with the decision.

“The Court's decision upholds well-established principles of federalism that prohibit interference in how municipalities and states manage relationships with their immigrant populations, particularly where public safety, health and welfare are concerned,” Carter said. “The Department of Justice sought to impose grant conditions that would undermine City policies that have proven effective in enhancing public safety by encouraging all of its residents to engage with local law enforcement without fear of adverse immigration law consequences.”

New York City has been a sanctuary city for several years. That position has been reaffirmed by city officials since President Donald Trump took office and promised to withhold federal funding from sanctuary jurisdictions.

The city's litigation was consolidated for the decision Friday with a lawsuit on the same issue from New York Attorney General Barbara Underwood and attorneys general from six other states. Underwood said in a statement that the decision reaffirmed the option for local and state law enforcement officials to dissociate from federal immigration authorities.

“As we argued, local law enforcement has the right to decide how to meet their local public safety needs—and the Trump administration simply does not have the right to require state and local police to act as federal immigration agents,” Underwood said. “The Trump administration's attempt to withhold these vital funds was nothing more than a political attack at the expense of our public safety.”

The lawsuit was over federal funding distributed by the DOJ referred to as the Byrne JAG grant,  which was named after Edward Byrne, a New York City police officer killed in the line of duty. The funding has been distributed to state and local governments since 2006.

The Trump administration, last year, imposed a set of conditions on the funding that required state and local governments to comply with certain requests by federal immigration authorities. The rule required that those agents have access to correctional facilities and be given advance notice if an immigrant is released from custody. It also prohibited states and localities from blocking their officials from speaking with ICE about an immigrant.

Ramos said in his decision that, aside from the constitutional issues taken from the Supreme Court's decision in Murphy, the new conditions also raised issues about the separation of powers between the U.S. attorney general and Congress.

“Congress has neither conditioned Byrne JAG funds on the three conditions here nor delegated the authority to impose these conditions to the executive branch,” Ramos wrote. “The Byrne JAG statute provides 'a firm commitment' of funding according to statutorily prescribed criteria, and the executive branch does not have 'the seemingly limitless power to withhold funds' from grantees who refuse to accept its unilaterally imposed conditions.”

The lawsuit also brought claims against the Trump administration on possible violations of the Administrative Procedure Act. The plaintiffs had argued that the DOJ did not consider the potential impact on states and cities of imposing conditions on the Byrne JAG funding. The Trump administration, in turn, produced documents in the administrative record they said supported their decision to create the rule.

Ramos acknowledged the DOJ's supporting documents, but said they were missing the other half of the equation.

“Conspicuously absent from all of these documents is any discussion of the negative impacts that may result from imposing the conditions, and the record is devoid of any analysis that the perceived benefits outweigh these drawbacks,” Ramos wrote. “Defendants did not consider whether the perceived benefits of the conditions outweighed these negative impacts on underserved local populations or whether such impacts could be mitigated.”

His decision struck down the conditions on the Byrne JAG funding, but only for the jurisdictions that were involved in the lawsuit. The DOJ was ordered to reissue award letters for the plaintiffs without the imposed conditions and to distribute any funding currently owed to them.

At the lawsuit's filing, New York City said the federal government had failed to release $4 million in the funding to them because of the rule. Underwood said at the time that New York state could stand to lose as much as $9 million because of the conditions.

The other plaintiff states on Underwood's lawsuit were Connecticut, New Jersey, Rhode Island, Washington, Massachusetts and Virginia.

A spokesman for the DOJ decline to comment on the decision Friday.

READ MORE: