A federal judge on Friday blocked a Trump administration rule that sought to strengthen the ability of federal officials to deny green cards to immigrants deemed likely to rely on government assistance -- the latest defeat for the administration's aggressive immigration policy in the courts.

Judge George B. Daniels issued a preliminary nationwide injunction, stopping the rule from taking effect on Oct. 15. New York State Attorney General Letitia James, who was part of the lawsuit, along with New York City and the states of Vermont and Connecticut, welcomed the decision.

TRUMP ADMINISTRATION BOOSTS ABILITY TO DENY GREEN CARDS TO IMMIGRANTS USING WELFARE PROGRAMS

“Once again, the courts have thwarted the Trump administration’s attempts to enact rules that violate both our laws and our values, sending a loud and clear message that they cannot rewrite our story to meet their agenda,” James said in a statement. "This rule would have had devastating impacts on all New Yorkers – citizens and noncitizens alike – and today’s decision is a critical step in our efforts to uphold the rule of law.”

While a “public charge” inadmissibility standard has long been part of U.S. immigration law, it had not been formally defined by statute. The rule, announced by U.S. Immigration and Citizenship Services in August, would have defined a “public charge” as an immigrant who received one or more designated benefits for more than 12 months within a 36-month period.

“The principle driving it is an old American value, and that’s self-sufficiency,” USCIS Acting Director Ken Cuccinelli told Fox News in an interview in August. “It’s a core principle -- the American Dream itself -- and it’s one of the things that distinguishes us, and it's central to the legal history in the U.S. back into the 1800s.”

Those benefits that would be designated included Supplemental Security Income (SSI), Temporary Assistance for Needy Families (TANF), as well as most forms of Medicaid and the Supplemental Nutrition Assistance Program (SNAP), commonly known as food stamps. The rule expands the number of benefits that can be considered from interim guidance issued in 1999.

ICE CHIEF WARNS COURT RULING BARRING DATABASE ACCESS ENDANGERS PUBLIC, RIPS 'JUDICIAL OVERREACH'

But Judge Daniels' ruling said that the government had failed to provide a reasonable explanation for changing the definition of public charge. Daniels also objected to the government’s inclusion of English proficiency as a sign of self-sufficiency.

“"The United States of America has no official language. Many if not most, immigrants who arrived at these shores did not speak English," he wrote.

He went on to claim that the definition has “no support in the history of U.S. immigration law” and described the rule as "repugnant."

"The rule is simply a new agency policy of exclusion in search of justification. It is repugnant to the American Dream of the opportunity for prosperity and success through hard work and upward mobility,” he wrote.

Cuccinelli responded to the ruling by predicting that the administration would ultimately prevail, arguing that "an objective judiciary will see this rule lies squarely within long-held existing law."

"Longstanding federal law requires aliens to rely on their own capabilities and the resources of their families, sponsors, and private organizations in their communities to succeed," he said in a statement. "The public charge regulation defines this law to ensure those seeking to come or stay in the U.S. can successfully support themselves financially and will not rely on public benefits as they seek opportunity here."

CLICK HERE FOR  THE ALL-NEW FOXBUSINESS.COM 

The legal defeat is the latest in a series of setbacks for the administration on immigration policy -- where it has faced legal defeats on both legal and illegal immigration. Trump last week issued a presidential proclamation that would require immigrant visa applicants to prove that they have health insurance, or the financial means to cover reasonable health care costs. That proclamation, scheduled to go into effect Nov. 3, was also expected to be hit by a legal challenge.

The moves by the administration have faced fierce opposition from immigrant activists, as well as many Democrats -- who have opposed measures to limit welfare for immigrants, while also calling for the extension of various forms of government aid to illegal immigrants as well.

Fox News' Marta Dhanis contributed to this report.