Federal judges in New York and California on Friday ordered a nationwide block in cases challenging a Trump administration policy that would make it far easier for the government to deny legal status to immigrants who use or are deemed likely to use public assistance. The rule was set to go into effect next week.

Judge George B. Daniels, of the U.S. District Court in Manhattan, ordered preliminary injunctions Friday afternoon in two related cases against the administration’s new “public charge” rule that could have denied legal permanent residency and other forms of legal status to many immigrants in the country who are deemed likely to use public assistance.

Daniels wrote in the decision explaining the order in a case announced by the New York attorney general's office in August that he found good cause to grant the motion because the plaintiffs in the case had sufficiently demonstrated their legal claims and that plaintiffs would suffer irreparable harm if the rule went into effect.

"Overnight, the Rule will expose individuals to economic insecurity, health instability, denial of their path to citizenship, and potential deportation," he wrote.

"It is a rule that will punish individuals for their receipt of benefits provided by our government, and discourages them from lawfully receiving available assistance intended to aid them in becoming contributing members of our society," he wrote.

"This rule would have had devastating impacts on New Yorkers and our nation, and today’s decision is a critical step in our efforts to uphold the rule of law," New York Attorney General Letitia James said on Twitter.

James announced the lawsuit challenging the rule alongside Connecticut and Vermont in August.

The order was also granted in a related case filed on behalf of five organizations that work with immigrants.

The rule "would have have erected an invisible wall to basically keep" low-income immigrants out," Hasan Shafiqullah, attorney-in-charge of the Legal Aid Society's immigration law unit, said following the order. The Legal Aid Society, the Center for Constitutional Rights, and Paul, Weiss, Rifkind, Wharton & Garrison LLP filed the suit on behalf of the five organizations.

Later on Friday afternoon, Judge Phyllis J. Hamilton issued a preliminary injunction in a case announced by California Attorney General Xavier Becerra. California was joined by Maine, Oregon, Pennsylvania and Washington, D.C., in the lawsuit.

In the California decision, Hamilton wrote that the counties and states had demonstrated a likelihood of irreparable harm "based on their loss of Medicaid funding from the federal government and increased operational costs they are likely to carry."

"Those harms stem directly from disenrollment of individuals seeking medical care in their jurisdictions, residing in their jurisdictions, and enrolling in certain other public benefits in their jurisdictions," the judge wrote.

"Today’s court ruling stops the Trump Administration’s heartless attempt to weaponize essential healthcare, housing, and nutrition programs," Becerra said in a statement. "This ruling is a victory for California communities who deserve to thrive, not live in fear."

The Department of Homeland Security previously defined “public charge” as someone who depended on cash assistance or government-funded long-term institutional care. The new rule expands the definition to include additional benefits such as food stamps, non-emergency Medicaid, certain prescription drug subsidies and housing vouchers.

And the rule would now define public charge as any immigrant who uses or is deemed likely to use at some point one public benefit for 12 months during a 36-month period. Receipt of two public benefits in one month counts as two months, the rule noted.

Once labeled a "public charge," immigrants could be denied green cards, visas and other forms of legal immigration status.

The policy was set to go into effect on Oct. 15. The lawsuits were among nearly a dozen across the country challenging the new rule.

The Department of Justice did not immediately respond to request for comment.

The Trump administration argues that expanding the meaning of “public charge” helps “protect American taxpayers” and ensures "that noncitizens in this country are self-sufficient and not a strain on public resources.”

Ken Cuccinelli, the director of U.S. Citizenship and Immigration Services, has defended the policy.

In August, he said he interpreted the inscription on the Statue of Liberty — "Give me your tired, your poor" — to mean, "We certainly expect people of any income to be able to stand on their own two feet."

"We invite people to come here and join us as a privilege," Cuccinelli said. "Not everyone has the right to be an American."

He added "all immigrants who can stand on their own two feet" and "pull themselves up by their bootstraps" are welcome.