The news cycle had not been kind to Attorney General Jeff Sessions by the time he made it to Philadelphia on Friday.

His boss was griping about him in the New York Times. He was fighting off rumors that he'd resign. And then, late Thursday, a federal judge had refused to reinstate the controversial executive order meant to be a cornerstone of his Department of Justice: one aimed at cutting federal funds from "sanctuary cities."

Now, Sessions was in one of those cities, addressing a packed room at the U.S. Attorney's Office that included the head of a police department he had threatened to defund.

For the most part, he stuck to the script. He touched on violent crime and decried gang violence. He lamented skyrocketing overdose deaths. Like President Trump before him, he cited the murder rate here, which is up 21 percent this year, and spoke at length about the unsolved killing of Tymier Frasier, a 14-year-old boy shot to death in Kensington in May.

And he said sanctuary cities like Philadelphia were harming their residents by not cooperating with the federal government. The city forbids police officers from asking about the immigration status of people they encounter, and does not honor requests from Immigration and Customs Enforcement to hold inmates in custody without a warrant.

Sessions urged officials here to "re-think" such policies. "Some jurisdictions in this country refuse to cooperate with federal immigration authorities and turn over illegal aliens who commit crimes — even MS-13 gang members," he said. He cited two oft-mentioned cases in which undocumented immigrants had been released from custody in Philadelphia, including one man who was later rearrested in connection with the rape of a child.

Still, Sessions said, he wasn't blaming local police.

"I know that you want to help," he said. "The problem is the policies that tie your hands."

Afterward, Philadelphia Police Commissioner Richard Ross told reporters that he supported Mayor Kenney's policies and believed local police should stay out of immigration enforcement.

"We have a tough enough time building relationships as it is," he said. "As it relates to violent crime, our problems are not people from other countries."

Ross said he had expected the attorney general would mention the city's murder rate, but he added that crime in general is down. And though Sessions didn't bring up his previous threats to pull federal funding from the police department over the city's sanctuary status, Ross said his department could "ill afford it."

"We want every bit of assistance that we can get," he said. "Residents of the city are entitled to that and deserve it."

Kenney bristled at Sessions' remarks, saying in a statement that the sanctuary city policy keeps the city safer.

"Blaming an entire group of people for our country's problems and violating their right to due process isn't constitutional and it isn't American. Philadelphia treats immigrants as we would any other resident under our criminal justice system," he said.

Studies have shown lower crime rates among immigrants than among native-born Americans.

Outside on Chestnut Street, a few dozen protesters carried signs reading "Trump is not my president" and "Build bridges, not walls." The group chanted and spoke for about three hours about the Trump administration's policies on immigration and mandatory minimum sentences. They also blocked traffic on Seventh Street for about an hour.

"Minorities are what makes this country great," said Bernadette Karpf, 21, of Upper Darby, protesting with the group RefuseFascism.org.

If he was worried about his job security Friday, Sessions didn't hint at it in his speech. And though the president had needled Deputy Attorney General Rod Rosenstein in his Times interview, too, Sessions took time to praise his second-in-command, who he said "sort of" runs the department. "He's from around here," he said, noting that Rosenstein grew up in the Philadelphia suburbs and attended the Wharton School: "He's been trained in how to read numbers."

"It's a great honor for me," Sessions told the crowd, "to serve as your attorney general. I do my best every day to be faithful to the laws of the constitution of this United States and fulfill the goals of the president that I share."