ABC News July 17, 2016

Obama Condemns Attack on Police in Baton Rouge, Promises Justice

WATCH: President Obama Says Nothing Justifies Attacks on Police

President Obama today said "nothing justifies violence against law enforcement" following the slaying of three police officers and wounding of three others in Baton Rouge, Louisiana, promising "justice will be done."

He said these type of attacks on public servants and police "have to stop" and that the motive for the attack remains unknown.

"We as a nation have to be loud and clear that nothing justifies violence against law enforcement," he said. "Attacks on police are an attack against all of us ... the rule of law that makes society possible."

President Obama Urges Police, Communities to Come Together During Town Hall: 'It's Not Us Versus Them' At Least Three Police Officers Dead in Shooting in Baton Rouge Obama: Murder Rate in African-American Community 'Way out of Whack'

The comments from Obama come as the country is reeling from a string of shootings that have raised racial tensions. Earlier this month two black men were shot dead by white police officers —- one in Baton Rouge and another outside St. Paul, Minnesota -— in cases that sparked outrage over concerns that the officers overreacted to the threats posed in each case.

Then during a protest in Dallas, five police officers were shot and killed and seven others wounded by a man who authorities say was upset about the recent police shootings.

Obama said the police that died in Baton Rouge, similar to those that were killed last week in Dallas, "were our fellow Americans, part of our community, part of our country, with people who loved and needed them, and who need us now."

The president said he touched base Sunday with Louisiana Gov. John Bel Edwards and Baton Rouge Mayor Kip Holden to receive the latest on the investigation into the shootings and pledge federal support.

"Every one right now focus on words and actions that can unite this country rather than divide it further," Obama said, adding: "We need to temper our words, open our hearts. All of us."

Obama has attempted to ease tensions that exist between police departments and minority communities and he recently hosted law enforcement officials at the White House.

He said the killing of a police officer anywhere has an impact of law enforcement officials across the country.

"I know whenever this happens, wherever this happens, you feel it. Your families feel it," he said. "But what I want you to know today is the respect and the gratitude of the American people for everything that you do for us."