Mayor Jim Kenney, left, and President Donald Trump. (Charles Mostoller/Getty Images)

President Donald Trump's move to punish Philadelphia for its "sanctuary city" policies were knocked by a federal judge on Wednesday, marking another tangle with the president from which Philadelphia emerged the victor.

U.S. District Judge Michael Baylson of Philly federal court ruled that the Trump administration and U.S. Attorney General Jeff Sessions could not constitutionally deprive Philadelphia of the Byrne Justice Assistant Grant (JAG), worth a few million dollars annually for police and public safety funding, in punishment for its sanctuary city policy under which local police do not cooperate with federal immigration authorities.

"This is an important moment for all Philadelphians, especially our immigrant community," Mayor Jim Kenney said in a statement after the judge's decision was announced on Wednesday. "Judge Baylson’s ruling is a total and complete victory for the city. It prevents a White House run by a bully from bullying Philadelphia into changing its policies. It is a ruling that should make clear to Attorney General Sessions that federal grant dollars cannot be used for a political shakedown."

In November 2017, Baylson issued a temporary restraining order stopping Trump and Sessions from blocking the grant, which was explicitly intended as a punishment of city leaders like Kenney, who staunchly stood by sanctuary city policies despite pressure and harsh rhetoric on immigrants from Trump.

 

“The judge has determined that the attorney general, for multiple reasons, violated the Constitution and unlawfully attached conditions to the City’s 2017 Byrne JAG grant application related to the city’s policies regarding immigrants residing in Philadelphia," said City Solicitor Marcel Pratt in a statement.

The funding from the JAG grant goes toward funding things like "police overtime, equipment enhancements, upgrades to courtroom technology, training for law enforcement, and alternative programming for low-level offenders," according to the city.

Philadelphia sued the federal government after new conditions were attached to the grant, including that Philadelphia "certify compliance with Section 1373 of Title 8 of the U.S. Code," give ICE 48 hours' notice before prisoners of interest were released, and allowing ICE "unfettered access to interview inmates in Philadelphia’s prison system," according to a city press release.

“Philadelphians, including the immigrant community, will be greatly relieved and heartened by this ruling," said Miriam Enriquez, Philadelphia's director of the Office of Immigrant Affairs in a statement. "This should reaffirm to our immigrant communities that we are glad you are here, we want you here, and we will always fight to ensure that Philadelphia remains a welcoming city to all.”

But while Philly may have won the battle, the war is far from over. ICE has stepped up arrests of illegal immigrants in the Philadelphia area partly in response to its sanctuary city status, and in a one-week raid in May, arrested 49 people, 14 of whom had been previously arrested by local police and released from custody despite ICE detainers holds being placed against them.