A federal appeals court in New York ruled Wednesday that the Trump administration has the right to withhold law enforcement grants to sanctuary cities.

The case involved seven states: New York, Connecticut, New Jersey, Washington, Massachusetts, Virginia and Rhode Island.

All of those states sued the Trump administration for withholding over the Justice Department’s April, 2017 letters “requiring proof of compliance” with U.S. immigration law for funding.

“Many of these jurisdictions are also crumbling under the weight of illegal immigration and violent crime,” the Justice Department wrote in a press release.