President Barack Obama has condemned the attack on police officers in Baton Rouge, Louisiana. The US leader said "there is no justification for violence against law enforcement," adding that the officers were killed in a "cowardly and reprehensible assault".

Three officers are dead and three others wounded – one critically – after the shooting which took place today (17 July) less than one mile from local police headquarters in Lousiana's state capital. Baton Rouge Police Cpl L'Jean Mckneely Jr said the assault took place outside the B-Quik convenience store on Airline Highway. A suspect, believed to be a lone gunman, was killed at the scene.

Addressing the nation in a press conference from The White House, Obama said the American people must stand united in condemning acts of violence against those in the first line of defence.

"Regardless of motive, the deaths of these three brave officers underscores the dangers that police across the country confront every single day.

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

President Obama
Barack Obama said the attacks on law enforcement officers was a 'cowardly assault' AFP/Getty

"We may not yet know the motives for this attack, but I want to be clear: there is no justification for violence against law enforcement. None. These attacks are the work of cowards who speak for no one. They right no wrongs. They advance no causes.

"The officers in Baton Rouge; the officers in Dallas – they were our fellow Americans, part of our community, part of our country, with people who loved and needed them, and who need us now – all of us – to be at our best. These are attacks on public servants, on the rule of law, and on civilised society, and they have to stop."

Speaking on the eve of the Republican Party's national convention, where Donald Trump will officially accept the GOP nomination, the US leader warned against inflammatory rhetoric after Trump reacted to the latest shootings by accusing the government of causing division in the community with an ineffective policing strategy.

Responding to the remarks, the president said: "We need to temper our words and open our hearts – all of us". He added: "Today's devastating assault on police officers in Baton Rouge is an assault on all of us. There is no justification for violence, for hate, for attacks on men and women who put their lives on the line every day in service of our families and communities."

The president said he spoke earlier with Louisiana Governor John Bel Edwards and Baton Rouge Mayor Kip Holden to offer his condolences and pledge federal support. "I've offered my full support, and the full support of the federal government, to Governor Edwards, Mayor Holden, the Sheriff's Office, and the Baton Rouge Police Department. And make no mistake – justice will be done.

Baton Rouge shooting
Police vehicles block access to part of Airline Highway after officers were fatally shot Jeffrey Dubinsky/Reuters

Republican Presidential candidiate Donald Trump earlier reacted with anger at the latest police shooting, attributing the attack to a lack of leadership as he demanded "law and order." Writing on his Facebook page he said: "We grieve for the officers killed in Baton Rouge today. How many law enforcement and people have to die because of a lack of leadership in our country? We demand law and order."

The Republic nominee also took to Twitter, posting: "We are TRYING to fight ISIS [Islamic State], and now our own people are killing our police. Our country is divided and out of control. The world is watching," he said.

Wisconsin's First District congressman and speaker of the House, Paul Ryan, tweeted: "Horrified by another senseless attack on law enforcement in #BatonRouge. We pray for the officers and their families."

He added: "An attack on the people who protect us is an attack on all of us. Let justice be done, and let healing be done too."

Valarie Hodges of the Louisiana House of Representatives reacted with dismay to the shootings. She said the attack on the first line of defence was "not just an attack against police officers it's an attack against America. I know every American in the US will be horrified."

NBC News have identified the shooter as Gavin Long of Kansas City, Missouri. City officials, however, have not confirmed the shooter's identity. The first police victim has been named by Palm Beach Sheriff's Office as 45-year-old Officer Montrell Jackson.

The violence comes less than a month after the shootings of two black men by police prompted widespread protests. Hundreds of people marched through the streets of Baton Rouge on 7 July after Louisiana police shot and killed a black man outside one of the city's convenience stores. Alton Sterling, 37, died from multiple gunshot wounds to the chest and back after being apprehended by police in the state's capital, Baton Rouge.

Less than 48 hours after Sterling's death, another black man, Philando Castile, was fatally shot by police in Minnesota. Castile's girlfriend live-streamed the aftermath of the shooting, which happened shortly after officers pulled over the pair in Minneapolis for a broken tail light.

The deaths of Alton Sterling and Philando Castile prompted a "revenge attack" after a lone gunman targeted police officers at a Black Lives Matter rally in Dallas.

The nephew of Alton Sterling has spoken out following the Baton Rouge attack, telling the Associated Press (AP) that his uncle "would not want this."

The latest police shooting comes amid heightened tensions over the killing of black men at the hands of police in the US. There were more than 1,000 fatal shootings by police last year.

A motive for the Baton Rouge shootings is yet to be established.