CHICAGO (AP) — A federal appeals court in Chicago has ruled that President Donald Trump's administration cannot withhold public safety grants from cities that don't cooperate with its immigration enforcement policies, agreeing with a temporary injunction imposed earlier this year by a lower court judge.

The decision by a three-judge panel of the 7th U.S. Circuit Court of Appeals Thursday says the administration exceeded its authority in establishing new conditions for cities to qualify for the grants.

The administration in July imposed a condition that cities receiving public safety grants must agree to inform federal agents when immigrants in the country illegally are about to be released from police detention.

All three judges agreed to the injunction Thursday, but one judge said it should be for Chicago only and not nationwide.