President Obama issued a simple and impassioned plea for calm and understanding on Sunday in the aftermath of the second police shooting this month and just ahead of the Republican and Democratic political conventions.

“We don’t need inflammatory rhetoric,” Obama said. “We don’t need careless accusations thrown around to score political points or to advance an agenda. We need to temper our words and open our hearts. All of us.”

He offered condolences for the three police officers killed Sunday morning in Baton Rouge and praise for law enforcement officers, expressing his "respect and gratitude" for their work.  But his main message was broadly directed to a country that seems increasingly on edge and specifically to the two candidates trying to replace him.

Obama described the upcoming political conventions in Cleveland and Philadelphia as a time “when our political rhetoric tends to be more overheated.”

"That is why it is so important that everyone ... right now focus on words and actions that can unite this country rather than divide it further," he said.

Earlier Sunday, presumptive Republican nominee Donald Trump issued a statement in which he suggested that Obama's leadership had contributed to the bloodshed.

"How many law enforcement and people have to die because of a lack of leadership in our country?" Trump said.  "We demand law and order."

Obama has sought to move quickly to try to defuse the anger surrounding the shootings of black men by police and the recent attacks on law enforcement officers. In the 10 days since five Dallas police officers were fatally shot while providing security for a protest march, Obama has spoken publicly about the matter almost every day.

He has addressed the violence in news conferences, memorial services, televised town hall meetings, meetings with law enforcement and civil rights activists, and, on Sunday, in the White House briefing room.

He has spoken out in defense of the protesters, pointing to racial disparities in searches, arrests and deadly shootings as proof of police bias. One of those deadly shootings occurred earlier this month in Baton Rouge, where police gunned down Alton Sterling in front of a convenience store.

And Obama has defended the work of police, noting that most perform difficult jobs with distinction.

This time, there was nothing subtle or nuanced in the president's plea for unity.

“My fellow Americans, only we can prove through words and through deeds that we will not be divided, and we are going to have to keep on doing it again and again and again,” he said. “That’s how this country gets united. That’s how we bring people of goodwill together. Only we can prove that we have the grace and the character and the common humanity to end this kind of senseless violence, to reduce fear and mistrust in the American family, to set an example for our children.”