U.S. Attorney General Jeff Sessions arrives at a news conference on September 5.Yuri Gripas / Reuters

A federal judge in Illinois blocked the Justice Department from denying grant money to sanctuary cities on Friday, handing the Trump administration another defeat in its efforts to crack down on jurisdictions that oppose federal immigration policy.

Judge Harry D. Leinenweber issued a preliminary injunction to block the policy change while legal proceedings continue. If the city of Chicago, which filed the lawsuit last month, prevails in those proceedings, the injunction will become permanent.

"By protecting criminals from immigration enforcement, cities and states with 'so-called' sanctuary policies make their communities less safe and undermine the rule of law,” a Justice Department spokesperson said in a statement after the ruling. “The Department of Justice will continue to fully enforce existing law and to defend lawful and reasonable grant conditions that seek to protect communities and law enforcement."

Chicago’s lawsuit challenges new conditions imposed by Attorney General Jeff Sessions through the Justice Department’s Byrne Justice Assistance Grant program. The program, created by Congress in 2005, allows the department to fund state and local law-enforcement initiatives. Through the grants, the Justice Department sends tens of millions of dollars to local police departments across the country—a revenue stream that can’t be lightly discarded by cash-strapped local authorities.

In July, Sessions announced that he would exclude sanctuary cities—a term for local jurisdictions that refuse to cooperate with federal immigration enforcement—from the program. “From now on, the Department will only provide Byrne JAG grants to cities and states that comply with federal law, allow federal immigration access to detention facilities, and provide 48 hours notice before they release an illegal alien wanted by federal authorities,” he said.

His announcement prompted a sharp rebuke from major cities like Chicago, whose police department received roughly $2 million in grants from the program in 2016. Mayor Rahm Emanuel filed a lawsuit against Sessions over his new requirements in August, arguing that the restrictions went beyond what Congress authorized when it created the program.

In his ruling on Friday, Leinenweber largely agreed with the city. He noted that Congress provided no explicit authorization for the attorney general to add the new conditions to the Byrne program.

“By failing to direct the court to any textual authority within the Byrne JAG statue itself, the Attorney General appears to concede the point,” he wrote. The Justice Department did cite a general provision elsewhere in federal law to support Sessions’s move, Leinenweber noted, but this argument “is persuasive only to the extent one scrutinizes the provision without the illumination of the rest of the statue.”

At the same time, the judge rejected Chicago’s argument that Section 1373 is unconstitutional. That provision in federal law forbids state and local jurisdictions from refusing to provide certain kinds of immigration-status information to the federal government. The section’s constitutionality has been disputed: My colleague Garrett Epps noted after Trump issued his original sanctuary-city order in January that the administration’s efforts to defund sanctuary cities could run afoul of two major Supreme Court cases on federalism. Ironically, he noted, those cases are considered significant conservative legal victories.

Leinenweber, however, declined to accept a similar argument from Chicago. “Without a doubt, Section 1373 restricts the ability of localities to prohibit state or local officials from assisting a federal program, but it does not require officials to assist in the enforcement of a federal program,” he noted. While Leinenweber acknowledged Chicago’s challenge had raised a novel constitutional question, he declined to side with the city under existing precedents.

Friday’s injunction is the latest in a string of courtroom defeats for the Trump administration in its efforts to impose a more hardline immigration-enforcement policy upon the federal and state governments. In April, a federal court in California blocked an executive order signed by President Trump in January that threatened to cut off federal funding for sanctuary cities. Judge William Orrick ruled that without express authorization from Congress, those funds “cannot be threatened merely because a jurisdiction chooses an immigration-enforcement strategy of which the president disapproves.” Sessions tried to water down the directive to pass legal muster the following month, but without success: Orrick refused to lift the injunction in July.

Trump’s stance on immigration, including his demands for a wall along the U.S.-Mexico border, won him a devoted base of supporters during the Republican presidential primaries in 2016. It also attracted the early support of Sessions, who established a reputation as an immigration hawk in his two-decade Senate career. The personal relationship between the two men collapsed over Sessions’s recusal from the Russia investigation in March, culminating in the attorney general’s offer to resign in May after Special Counsel Robert Mueller was appointed. Trump ultimately declined the offer, and Sessions has reportedly endured the president’s intermittent tirades against him so he can continue to enact his immigration policies.

But their vision of fewer immigrants entering the United States, legal or otherwise, has proven difficult to put into practice. Trump’s controversial travel ban targeting six Muslim-majority countries spent months in legal purgatory after the federal courts rejected it; a diminished version is currently in force while the Supreme Court prepares to decide its fate in October. Efforts to secure funding for the border wall are also in limbo as Congress wrestles with other legislative priorities.

Some of the damage has been self-inflicted. Earlier this month, Sessions announced that Trump would repeal the Deferred Action for Childhood Arrivals program, an Obama-era initiative to defer deportation for undocumented immigrants brought into the U.S. as children, in six months. But only hours after Sessions made the announcement, Trump publicly undercut his attorney general’s stance by suggesting he might not shut down the program after the deadline passes. Democratic congressional leaders are currently negotiating with the president to protect the 800,000 DACA applicants who would be jeopardized by the program’s repeal.

If the Justice Department appeals Friday’s ruling, the next stop for the lawsuit would be the Seventh Circuit Court of Appeals, which is also based in Chicago. A ruling from that court could then be appealed to the Supreme Court, which reconvenes next month for its 2017-2018 term.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.