President Donald Trump ripped Chicago city leaders for refusing to work with federal immigration authorities during a speech Monday.

In his first official visit to Chicago since entering the White House, Trump delivered a speech at the International Association of Chiefs of Police conference. At numerous moments during his speech, the president related the fight against crime to the need for local police to work with their federal partners. The biggest offenders, the president said, are Chicago’s leaders.

“Chicago is, unfortunately, the worst sanctuary city in America,” Trump said at the national police chiefs conference.

“Chicago protects criminals at a level few could even imagine. Last year, in Cook County alone, ICE asked local law enforcement people to ‘please, pretty please, we beg you, we’ll do anything necessary to stop crime. We want to stop crime. Please detain 1,162 people, please,'” the president said. “But in each case, the detainer was denied.”

The comments were the latest in a war of words between the U.S. federal government and the city’s leaders. Chicago Mayor Lori Lightfoot openly called Immigration and Customs Enforcement (ICE) “xenophobic” and “racist” in September, and has adamantly refused to allow her police force to respect ICE detainer requests.

An internal memo that was leaked to the public revealed the Chicago Police Department is instructing officers to wait for a supervisor instead of immediately helping Department of Homeland Security personnel, and even to “leave the scene” if the situation involves an immigration arrest.

Trump directed his aim at Eddie Johnson, the superintendent of the Chicago Police Department, during his Monday speech.

“People like Johnson put criminals and illegal aliens before the city of Chicago, and those are his values, and frankly those values to me are a disgrace. I will never put the needs of illegal criminals before I put the need of law-abiding citizens. It’s very simple to me,” he said.

“So when Eddie Johnson and many other people from lots of other regions and areas support sanctuary cities, it’s really, in my opinion, a betrayal of their oath to the shield, and a violation of his duty to serve and to protect,” the president continued. “The courageous police officers of Chicago … they could solve this problem quickly.”

The speech revolved largely around the topic of immigration, with Trump inviting both Customs and Border Protection (CBP) acting commissioner Mark Morgan and ICE acting director Matthew Albence onto the stage to say a few words. (RELATED: ‘Sanctuary’ Sheriff Ignoring Calls And Emails From ICE After Publicly Calling For Dialogue, Agency Says)

The president said Afghanistan, by comparison, is a safer place than Chicago.

“The people of Chicago — the people want this. And with the families of Chicago, not the criminals and gang members that are here illegally. And not the stupid politicians who have no idea what they’re doing,” he said.

WATCH:

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.