Police officers block off a street near the location of a shooting in Baton Rouge, Louisiana, USA, 17 July 2016.

Just five days after attending a memorial service last week in Dallas for five police officers slain in an ambush, President Barack Obama found himself condemning a similar shooting in Baton Rouge, Louisiana.

On Sunday, he recalled his own eulogy in Dallas: "I said that that killer would not be the last person who tries to make us turn on each other - nor will today's killer. It remains up to us to make sure that they fail. That decision is all of ours. The decision to make sure that our best selves are reflected across America, not our worst - that's up to us."

He warned that with the Republican and Democratic parties formally nominating their presidential candidates for the November elections, the country was "about to enter a couple of weeks ... where our political rhetoric tends to be more overheated than usual."

"And that is why it is so important that everyone - regardless of race or political party or profession, regardless of what organizations you are a part of - everyone right now focus on words and actions that can unite this country rather than divide it further."

Populist billionaire Donald Trump, set to accept the conservative Republican Party's nomination on Thursday, tweeted shortly after Obama's appearance that the president "doesn't have a clue."

"Our country is a divided crime scene, and it will only get worse!" Trump declared. "Our country is totally divided and our enemies are watching. We are not looking good, we are not looking smart, we are not looking tough!"

Trump, running on the slogan "Make America Great Again," had earlier evoked his frequent accusation that Obama has failed to adequately take the fight to Islamic State terrorists in Iraq and Syria.

"We are TRYING to fight ISIS, and now our own people are killing our police. Our country is divided and out of control," he said.

Former first lady Hillary Clinton, who was Obama's secretary of state from 2009-13, will accept the nomination of the liberal Democratic Party on July 28.

"Today's devastating assault on police officers in Baton Rouge is an assault on all of us," she said. "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."

Clinton also called for unity in the face of tragedy.

"We must not turn our backs on each other. We must not be indifferent to each other," she said.

"We must all stand together to reject violence and strengthen our communities. Our thoughts and prayers are with the friends and families of the police officers who were killed and injured today."

At the White House, Obama warned: "We don't need inflammatory rhetoric. 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."

The July 7 incident in Dallas followed the death of 37-year-old Alton Sterling in Baton Rouge two days before, in yet another killing of unarmed African-American men by police.

Then on July 6, Philando Castile, 32, died after being shot four times by a police officer during a traffic stop near Minneapolis, Minnesota.

The incidents inflamed tensions among minority communities.

Obama pointed to the example set after the killings in Dallas, where "a community came together to restore order and deepen unity and understanding."

"We need the kind of efforts we saw this week in meetings between community leaders and police - some of which I participated in - where I saw people of good will pledge to work together to reduce violence throughout all of our communities," he said.

"That's what's needed right now. And it is up to all of us to make sure we are part of the solution and not part of the problem."

Latest news

Merkel calls for fewer EU regulations as nationalist sentiments grow

As voters in the Netherlands, France and Germany show increasing support for nationalist, euro-sceptic political movements ahead of this year's elections, German Chancellor Angela Merkel has called for limits on EU regulations.

French prosecutors transfer Fillon case to investigative judge

The French judiciary has opened a formal investigation in connection with presidential candidate Francois Fillon to examine whether the employment of his wife as a parliamentary employee was a sham, the country's financial prosecutors' office said Friday.

White House bars major news outlets from press briefing

Major news organizations, which were Friday blocked by the White House from attending an informal press briefing, condemned the move just hours after President Donald Trump described parts of the media as "the enemy of the people."

Report: German intelligence spied on BBC, other foreign journalists

Germany's intelligence agency monitored foreign journalists at the BBC, the New York Times and other news organizations from 1999 onwards across several countries, according to a Friday report from Der Spiegel magazine.

Classroom for Islamic religious education opened in Split

A classroom for Islamic religious education, whose equipment was financially assisted by city and county authorities, was opened in the coastal city of Split on Friday.

Ministry say no licences for export of military goods to Saudi Arabia issued in 2016

The Economy, Enterprise and Crafts Ministry on Friday issued a statement regarding media reports about export licences for military goods, stressing that in 2016 it did not issue any licences for the export of military goods to Saudi Arabia.

Croatia for preserving Bosnia's stability

Croatia on Friday supported the stability of Bosnia and Herzegovina (BiH), calling on its authorities to adopt decisions in institutions, after a request by BiH Presidency Bosniak member Bakir Izetbegovic to review a ruling which acquitted Serbia of genocide.

Mexico is not a migrant "waiting room" for US, interior minister says

Mexico will not accept undocumented immigrants from other countries whom the United States plans to deport, Mexico's interior minister said Friday.

Right-wing populist Wilders declines first Dutch election debate

Candidates from nine Dutch parties answered questions from journalists Friday at the first national radio debate of the election campaign, but the leading candidate

Bosnian Croat reps insist on channel airing programmes in Croatian

Being one of the constituent peoples, the Croats in Bosnia and Herzegovina are entitled to a broadcaster that will air programmes in their native language, HNS BiH official Ivan Vukoja said at a news conference in Mostar on Friday.

Same-sex couples in Slovenia can marry

A Slovenian law allowing same-sex couples to marry went into force on Friday and the first civil registrar ceremony, between two women, is to take place in Maribor on Saturday, the town's Vecer daily said.

Moody's changes Agrokor's outlook to negative

The Moody's rating agency on Friday changed its outlook for the Agrokor food retailer from stable to negative, affirming its rating of B3.