(Reuters) - A federal appeals court said on Friday the Trump administration cannot cut off grants to Philadelphia for its refusal to cooperate with immigration authorities seeking to deport immigrants who are in the country illegally.

FILE PHOTO: A demonstrator holds a sign to protest against U.S President Donald Trump's executive order banning refugees and immigrants from seven primarily Muslim countries from entering the United States during a rally in Philadelphia, Pennsylvania, U.S. February 4, 2017 REUTERS/Tom Mihalek

In a 3-0 decision, the 3rd U.S. Circuit Court of Appeals in Philadelphia said the U.S. attorney general lacked power to condition that city’s receipt of $1.6 million for local law enforcement on its compliance with three new requirements.

These included alerting Immigration and Customs Enforcement officials when undocumented immigrants are being released from prison, providing access to interview immigrants, and barring the withholding of immigrants’ citizenship status.

Several other “sanctuary cities” have also opposed to the requirements, and Chicago, New York and San Francisco have won court rulings blocking their enforcement.

In Friday’s decision, Circuit Judge Marjorie Rendell said the attorney general has only limited oversight of the program for awarding the Byrne Justice Assistance Grants.

“Allowing the attorney general to withhold all funds because a jurisdiction does not certify compliance with any federal law of the attorney general’s choosing undermines the predictability and consistency embedded in the program’s design,” Rendell wrote.

The U.S. Department of Justice did not immediately respond to requests for comment.

Friday’s decision largely upheld a June 2018 ruling by U.S. District Judge Michael Baylson in Philadelphia, but voided his requirement that the government obtain warrants before seeking custody of immigrants in city custody.

It was issued a couple of hours before President Donald Trump declared a national emergency to fund a wall at the U.S.-Mexico border without congressional approval. Democrats vowed to challenge his action as unconstitutional.

Philadelphia Mayor Jim Kenney praised the appeals court decision, in a statement referring to Trump’s declaration.

“The conditions imposed by the DOJ were an unconscionable attempt to bully the city and its residents into changing our policies,” Kenney said. “On the very day the president declared a bogus national emergency to build a useless wall, I say to our immigrant community: we are glad you call Philadelphia home.”

The case is Philadelphia v. Attorney General of the United States, 3rd U.S. Circuit Court of Appeals, No. 18-2648.