President Obama’s speech to the International Association of Chiefs of Police in Chicago was always going to require some careful political balancing, but the math got a little trickier over the last few days. Last week, the president voiced some carefully measured support for the Black Lives Matter movement, saying, “There is a specific problem that is happening in African American communities that is not happening in other communities. And that is a legitimate issue that we’ve got to address.”

A day later, FBI Director James Comey argued in a speech in Chicago that one reason for a spike in violent crime in some cities was the “Ferguson effect,” in which police were reluctant to arrest people for fear of being filmed. (On Monday, Comey said at the IACP conference that he had no hard proof for the idea.) His remarks reportedly irritated Justice Department officials.

That set the stage for Obama’s speech Tuesday afternoon, in which he tried to strike a balance between those two perspectives: those of the activists, and those of law-enforcement officers like Comey. “This is ... a hard conversation—but if you don't mind, I’m going to go ahead and have it,” he said. “This is one of the benefits of not having to run for office again.”

But the conversation was fairly soft. It was classic Obama: Admitting that every side had something to offer, steering a moderate path, and calling on all sides to step up and compromise.

The president was strongly supportive of law enforcement: “In you, we often see America at its best. You don’t just protect us from each other, you build a foundation so that we can trust each other and rely on each other.” He said that falling crime rates did not mean that minority concerns about the police could be brushed aside, but he said that police should not receive nearly so much blame.

“Too often, law enforcement gets scapegoated for broader failures of our society and our criminal-justice system,” he said. “You do your job with distinction no matter the challenges you face. But we can’t expect you to contain and control problems that the rest of us aren’t willing to face or do anything about‚ problems ranging from substandard education to a shortage of jobs and opportunity, an absence of drug-treatment programs, and laws that result in it being easier in too many neighborhoods for a young person to purchase a gun than a book.”

Obama also blamed the media for focusing on “the sensational and the controversial.” He added: “The countless acts of effective police work rarely make it on the evening news.” And he said that every profession has bad actors, not just law enforcement, though he criticized the impulse to “close ranks” when police come under scrutiny.

Even the harsher parts of the speech were fairly tame. “We’ve got to resist the false trap that says either there should be no accountability for police, or that every police officer is suspect, no matter what they do,” he said, delivering to the coup de grace to what must be a straw man: “Neither of these things can be right.” Indeed.

Obama joked that “before I had a motorcade,” he would sometimes get pulled over by the police. “Most of the time I got a ticket, I deserved it. I knew why I was pulled over. But there were times when I didn’t,” he said, adding that many African Americans felt the same way. “The data shows that this is not an aberration. It doesn’t mean each case is a problem. It means that when you aggregate all the cases and you look at it, you've got to say that there’s some racial bias in the system.”

Nor did Obama shy away from discussing the high rates of crime in black communities—“black-on-black crime” and issues in African American communities that he is sometimes (unconvincingly) accused of overlooking. Chicago, where black communities have seen extremely high violent crime in the last few years, was a natural place to discuss this. “Our divides are not as deep as some would suggest,” he said. “I don’t know anyone in the minority community who doesn’t want strong effective law enforcement.”

For much of the rest of the speech, Obama was able to speak on issues where many police chiefs agree with him. He renewed calls for stronger gun laws, including background checks and banning the sale of military-style weapons to civilians. He called for reducing prison populations and working to better retrain prisoners for reentry into street life. (“I can’t thank the chiefs enough here, because a lot of you are out front on this issue.”) He applauded some signs of progress on a bipartisan criminal-justice reform bill on Capitol Hill. (“This is something I don’t get to say very often: I am encouraged by what Congress is doing,” he joked.) He also called for better funding for police to try crime-fighting strategies that are proven to work.

Obama’s positive comments about police are in some measure a factor of knowing his audience. His insistence on emphasizing what police do right and pointing a finger elsewhere will likely upset some police-reform activists. In this way, they fit a classic Obama conciliator pattern: When he gives something to one group, he is careful to give to another soon after. In January, for example, he both delighted and enraged environmentalists by banning oil drilling in some parts of the Arctic while opening parts of the Atlantic Coast to exploration. When Obama gave to Black Lives Matter from one hand with his approving comment, it practically foretold that he would give to police chiefs from the other Tuesday.