Obama: 'Attacks on police are an attack on all of us'

In an earlier written statement, Obama said that the ambush was ""the work of cowards who speak for no one."

Hours later, he delivered remarks on the killings from the White House.

"The death of these three brave officers underscores the danger that police across the country confront every single day," Obama said. "We as a nation have to be loud and clear that nothing justifies violence against law enforcement. Attacks on police are an attack on all of us and the rule of law that makes society possible."

Photos from Baton Rouge:

17PHOTOS

Baton Rouge shooting -- images from the scene

See Gallery

Baton Rouge shooting -- images from the scene

BATON ROUGE, LA - JULY 17: An East Baton Rouge Police officer patrols Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police. (Photo by Sean Gardner/Getty Images)

BATON ROUGE, LA - JULY 17: East Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police. (Photo by Sean Gardner/Getty Images)

BATON ROUGE, LA - JULY 17: East Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police. (Photo by Sean Gardner/Getty Images)

BATON ROUGE, LA - JULY 17: Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police. (Photo by Sean Gardner/Getty Images)

BATON ROUGE, LA - JULY 17: Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police. (Photo by Sean Gardner/Getty Images)

BATON ROUGE, LA - JULY 17: Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police. (Photo by Sean Gardner/Getty Images)

An American flag flies at half mast near the scene of a fatal shooting of police officers in Baton Rouge, Louisiana, United States, July 17, 2016. REUTERS/Joe Penney

A police helicopter flies near the scene of a fatal shooting of police officers in Baton Rouge, Louisiana, United States, July 17, 2016. REUTERS/Joe Penney

An officer from the Louisiana Wildlife Service blocks off a road near the scene of a fatal shooting of police officers in Baton Rouge, Louisiana, United States, July 17, 2016. REUTERS/Joe Penney

Law enforcement vehicles block access to Airline Highway near the scene of a fatal shooting of police officers in Baton Rouge, Louisiana, U.S., July 17, 2016. REUTERS/Jonathan Bachman

Police officers block off Airline Highway near the scene of a fatal shooting of police officers in Baton Rouge, Louisiana, United States, July 17, 2016. REUTERS/Joe Penney

A law enforcement helicopter is seen near the scene where police officers were shot in Baton Rouge, Louisiana, U.S. July 17, 2016. REUTERS/Jonathan Bachman

A law enforcement helicopter is seen near the scene where police officers were shot in Baton Rouge, Louisiana, U.S. July 17, 2016. REUTERS/Jonathan Bachman

Lew enforcement officers block a road after a fatal shooting of police officers in Baton Rouge, Louisiana, U.S. July 17, 2016. REUTERS/Jonathan Bachman

Police officers block off a road near the site of a shooting of police in Baton Rouge, Louisiana, United States, July 17, 2016. REUTERS/Joe Penney

Police officers arrive near the site of a shooting of police in Baton Rouge, Louisiana, United States, July 17, 2016. REUTERS/Joe Penney

Up Next

See Gallery

Discover More Like This

HIDE CAPTION

SHOW CAPTION

of

SEE ALL

BACK TO SLIDE

Obama said he had spoken with Louisiana Gov. John Bel Edwards and Baton Rouge Mayor Kip Holden to offer them the support of the federal government and to reiterate support for law enforcement.

He proceeded to say that he had contacted Attorney General Loretta Lynch and that the FBI was on the scene with all levels of government to ensure that "justice will be done."

The president then offered prayers for the families of the fallen and wounded officers.

"This has happened far too often," Obama said as he referred to meetings he held with law enforcement in the wake of the Dallas ambush. "I'm surrounded by the best of the best every single day."

He then called for "words and actions that can unite this country rather than divide it further" in light of political division.

"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."