NEW YORK (Reuters) - A U.S. judge on Monday dismissed a lawsuit seeking to void President Donald Trump’s decision to cap a popular tax break for filers in high-tax states as part of the 2017 tax overhaul.

U.S. District Judge Paul Oetken in Manhattan said New York, Connecticut, Maryland and New Jersey failed to show that the $10,000 cap on federal deductions for state and local taxes exceeded Congress’ constitutional power to levy income taxes.

He also found no basis to conclude that the so-called SALT cap was an effort to coerce states through “economic dragooning” into lowering their own taxes and cutting services, in line with the federal government’s own policy preferences.

The states failed to show that the cap “puts them to the forced choice of lowering tax rates or facing budgetary catastrophe,” Oetken wrote.

Oetken’s decision is a victory for Trump, who used the cap to help pay for his $1.5 trillion tax overhaul, which included cutting taxes for wealthy Americans and slashing the corporate tax rate.

The cap affects people mainly in Democratic-leaning “blue” states such as California and the four states that brought the lawsuit in July 2018. Trump is a Republican, and Congress was controlled by Republicans in 2017.

New York Governor Andrew Cuomo, a Democrat, said the state may appeal, faulting Trump for targeting blue states to pay for tax cuts for corporations and the rich. The governor said the SALT cap alone costs New Yorkers $15 billion a year.

“This policy is unprecedented, unlawful, punitive and politically motivated--and it must be stopped,” Cuomo said.

The U.S. Department of Justice did not immediately respond to requests for comment.

The cap allows individuals and married taxpayers filing jointly who itemize deductions to deduct only up to $10,000 annually for state and local income, property and sales taxes. Married individuals filing separately are capped at $5,000.

States opposed to the cap said it would depress home prices, spending, jobs and economic growth and make it harder to pay for hospitals, police, schools, and road and bridge construction and maintenance.

New York said the average SALT deduction claimed by 3.3 million residents who itemized deductions on their federal returns was $21,943 in 2015.

In February, the administration estimated that the cap would have left 10.9 million filers unable to deduct $323.1 billion in state and local taxes from their 2018 returns.

Some states have proposed letting taxpayers classify some tax payments as charitable contributions, which are not subject to the cap. The Treasury Department and Internal Revenue Service have warned against such “workarounds.”