(Reuters) - A federal appeals court on Thursday said the U.S. Justice Department cannot deny public safety grants to so-called sanctuary cities that limit cooperation with the Trump administration’s crackdown on illegal immigration.

U.S. President Donald Trump boards Air Force One after visiting the Joint Interagency Task Force South (JIATF South) federal anti-smuggling and anti-drug trafficking agency in Key West, Florida, U.S. April 19, 2018. REUTERS/Kevin Lamarque

The Seventh U.S. Circuit Court of Appeals affirmed a lower court injunction in a case brought by the city of Chicago.

The appeals court agreed the injunction should apply nationally while the lawsuit proceeds in federal court.

The case is one of a number of battles between the administration of Republican President Donald Trump and Democratic state and local leaders over immigration, healthcare, the environment and other issues.

Chicago sued last year after U.S. Attorney General Jeff Sessions announced he would cut off cities from certain Justice Department grants unless they allowed federal immigration authorities unlimited access to local jails and provided 48 hours’ notice before releasing anyone wanted for immigration violations.

The lawsuit contended that Sessions exceeded his authority by imposing new conditions beyond those Congress prescribed when it established the grant program.

In its ruling on Thursday, a three-judge Seventh Circuit panel said its role was not to decide national immigration policy, but rather to protect the separation of powers between the branches of the federal government.

Slideshow ( 2 images )

“The Attorney General in this case used the sword of federal funding to conscript state and local authorities to aid in federal civil immigration enforcement,” the court wrote. “But the power of the purse rests with Congress[.]”

Justice Department spokesman Devin O’Malley said the agency believes it exercised authority given by Congress to promote cooperation with immigration authorities.

“We will continue to fight to carry out the Department’s commitment to the rule of law, protecting public safety, and keeping criminal aliens off the streets to further perpetrate crimes,” O’Malley said.

Trump made tougher immigration enforcement a centerpiece of his campaign and presidency, along with a pledge to build a wall at the U.S.-Mexican border.

All three judges on the Seventh Circuit panel were nominated by Republican presidents.

Police agencies in so-called sanctuary jurisdictions, like Chicago, New York and Los Angeles, have generally barred their officers from routinely checking individuals’ immigration status, and from keeping anyone locked up longer than otherwise warranted at the request of immigration agents.

Chicago Mayor Rahm Emanuel said on Thursday the city will stand its ground when it comes to immigrants.

“We’re not going to allow the Trump Justice Department to bully our values,” he said.

The grants at issue under the Edward Byrne Memorial Justice Assistance Grant, or Byrne JAG program, typically are used to help police improve crime-fighting techniques, buy new equipment and assist victims of crime.

After a Chicago judge issued the nationwide injunction last September, the Justice Department said in a court filing it would be forced to delay grants to law enforcement across the country regardless of sanctuary status while the litigation proceeds.

Edward Siskel, Chicago’s corporation counsel, said on Thursday the city would continue to fight for the federal government to release withheld grant funds.