President Barack Obama on Tuesday defended police officers who have come under intense scrutiny amid a breakdown in relations between law enforcement and minority communities, and said police can’t be expected to contain problems that society refuses to solve.

In remarks to the International Association of Chiefs of Police, meeting in the president’s Chicago hometown, Obama said society wrongly expects police to control societal ills stemming from unemployment, poor education, inadequate drug treatment programs and lenient gun laws.

“Too often, law enforcement gets scapegoated for the broader failures of our society and criminal justice system,” Obama told police chiefs from around the U.S. and the world. “I know that you do your jobs with distinction no matter the challenges you face. That’s part of wearing the badge.”

Obama’s tribute to police comes amid a national debate that followed the deaths of unarmed black men in Florida, Missouri and elsewhere, giving rise to the Black Lives Matter movement.

Last week, Obama defended Black Lives Matter and said its activists are illuminating a legitimate issue that black communities face. But he sought Tuesday to avoid making it about police versus their communities.

Read more at JET.