A federal judge has tossed lawsuit by New York and other states against the $10,000 cap on state and local tax deductions in a move that upheld a key provision of the federal government’s 2017 tax law.

Gov. Andrew Cuomo has railed against the cap on the cap on deductions, arguing the measure was meant to harm higher tax states like New York, where taxpayers could deduct their state and local taxes from their federal income tax.

The cap, however, limited those deductions to $10,000 — a move state officials worried would send wealthier New Yorkers to states where taxes are not as high.

The multiple states challenging the SALT cap argued the move unfairly singled out Democratic states where taxes are higher and questioned the constitutionality of the cap.

Federal Judge Paul Oetekn, however, reaffirmed the cap as part of Congress’s “broad powers” to write and pass tax legislation under the Constitution.

The cap, like any federal tax provision, will affect some taxpayers more than others and, by extension, will affect some states more than others,” the judge wrote in his ruling. “But the cap, again like every other feature of the federal Tax Code, is a part of the landscape of federal law within which states make their decisions as to how they will exercise their own sovereign tax powers.”

He added that states challenging the cap have failed to show it restrains their “decision-making process” and had “no basis for concluding that the SALT cap is unconstitutionally coercive.”