In a win for the Trump administration, the U.S. Court of Appeals for the Second Circuit ruled Wednesday that the Justice Department could withhold millions of dollars in federal law-enforcement grants from Connecticut, New York City and six other states over their sanctuary policies on immigration.

The unanimous ruling from a three-judge panel of the Manhattan-based appeals court lifted an injunction by a lower court that prevented the Trump administration from attaching immigration-related conditions to applications for federal funds under a federal grant program and placed the Second Circuit at odds with three other circuit courts that have upheld similar injunctions.