The Department of Justice can’t withhold millions of dollars in public safety grants from cities that refuse to share suspects’ immigration status with federal officials, the U.S. Court of Appeals for the Seventh Circuit ruled today.

The Seventh Circuit is the first federal appeals court to rule on sanctuary policies adopted by many cities around the country.

The decision rested on “one of the bedrock principles of our nation,” the separation of powers, Judge Ilana Diamond Rovner wrote for the...