“The rule is simply a new agency policy of exclusion in search of a justification,” Judge George B. Daniels of the Federal District Court in Manhattan wrote in his ruling. “It is repugnant to the American Dream of the opportunity for prosperity and success through hard work and upward mobility.”

The regulations published by the Department of Homeland Security on Aug. 14 expand the definition of what it means to be a “public charge,” making it more difficult for immigrants to be approved for a green card if they have received benefits such as Medicaid, housing assistance or food stamps, or are deemed likely to receive them in the future.

For a nation that has long welcomed immigrants from poor countries seeking to improve their lot, the new rule could drastically change the composition of newcomers admitted to the United States. The rule would favor those who are educated and wealthy, more likely to hail from Europe than from the developing world.

The new standards would directly affect about 1.2 million applicants annually, including about 500,000 who are already in the country. But that figure does not include millions of family members and others who might also be affected. Immigration experts said the rules would disproportionately affect applicants from Africa and Latin America.

Federal immigration policy has long allowed the authorities to consider, when admitting new immigrants, the degree to which they might be a burden on the public purse. For the last 20 years, a public charge has been defined as a person “primarily dependent” on the government for subsistence, either by receiving public cash assistance or long-term institutional care.

The new regulations would lower the bar for how much assistance an immigrant might receive — or be likely to need in the future — before being deemed ineligible for legal residence.

In a statement on Friday, the White House said the court rulings prevented the government from carrying out what it said was a longstanding provision of federal law. “The rulings today prevent our nation’s immigration officers from ensuring that immigrants seeking entry to the United States will be self-sufficient,” the statement said, “and instead allow noncitizens to continue taking advantage of our generous but limited public resources reserved for vulnerable Americans.”