The Supreme Court voted 5-4 to clear President Donald Trump’s immigrant wealth test on Monday. The test is supposed to screen green card applicants who are seen as being a risk to becoming dependent on taxpayer-funded government assistance and benefits.

The party-line vote overturned a New York judge’s ruling that was blocking the new rule from going into effect while the legal fight continued on in the courts.

Justices John Roberts, Clarence Thomas, Samuel Alito, Neil Gorsuch and Brett Kavanaugh voted to overturn the ruling, while Democrat-appointees Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayer and Elena Kagan dissented.

The new rule essentially expands what it means to be a “public charge,” giving officials broader power to deem whether or not someone could end up becoming a burden to U.S. taxpayers.

New York, Connecticut and New York City urged the new rule be blocked, arguing in a filing that the new rule will “radically disrupt over a century of settled immigration policy and public-benefits programs.”

While the court did not give an explanation for its ruling, Gorsuch wrote an opinion for himself and Thomas stating the Supreme Court should cut down on the power of federal trial judges to issue nationwide orders blocking a government initiative.

“The real problem here is the increasingly common practice of trial courts ordering relief that transcends the cases before them,” Gorsuch wrote.

How the Immigrant Wealth Test Will Be Administered

Immigrants will be considered public charges if they are determined to be likely to receive public benefits like Medicaid, public housing assistance or food stamps for more than 12 months in a 36-month period.

To figure that out, the Department of Homeland Security can consider a list of potential factors including age, health, education, proficiency of speaking English, family size, wealth and credit score.

The court’s ruling “represents a reasonable and lawful exercise of the substantial discretion Congress has long vested in the executive branch to make public-charge admissibility determinations,” U.S. Solicitor General Noel Francisco said in court papers.

Under the previous rules, a person wasn’t considered a public charge unless they were receiving cash benefits from the government and they were primarily dependent upon the aid.