PROVIDENCE, R.I. (AP) — A federal judge has blocked the Trump administration’s attempt to reallocate federal Homeland Security funding away from states that refuse to cooperate with certain federal immigration enforcement.

U.S. District Judge Mary McElroy's ruling solidified a victory for a coalition of 12 attorneys general who sued the administration earlier this year after being warned that their states would face drastic reductions in federal grants due to their ‘sanctuary’ status.

These cuts amounted to over $233 million affecting Connecticut, Delaware, the District of Columbia, Massachusetts, Minnesota, New York, Rhode Island, Vermont, and Washington. This funding is part of a $1 billion program intended to be allocated based on assessed risks, with states distributing much of it to police and emergency services.

The funding cuts were first brought to light following an earlier federal court decision that ruled it unconstitutional for the government to require states to assist in immigration enforcement in exchange for FEMA disaster funding. In her comprehensive 48-page ruling, McElroy observed that the federal government was assessing states' cooperation with immigration enforcement when deciding on funding amounts for the Homeland Security Grant Program and others.

Judge McElroy highlighted the arbitrary nature of the funding cuts, stating, “What else could defendants’ decisions to cut funding to specific counterterrorism programming by conspicuous round numbered amounts... be if not arbitrary and capricious?”

Moreover, she noted the significant role that these funds play in ensuring public safety, especially referencing the recent tragic shooting at Brown University, where safety funding would be essential in response to such incidents. The judge criticized the government’s approach, saying, “To hold hostage funding for programs like these based solely on what appear to be defendants’ political whims is unconscionable and, at least here, unlawful.”

Following the ruling, McElroy directed the Department of Homeland Security to reinstate the previously allocated funds to the affected states. Massachusetts Attorney General Andrea Joy Campbell responded positively, emphasizing that this ruling prevents the Trump administration from penalizing states for their immigration policies, particularly by denying critical funding necessary for disaster preparedness and response.