WARSAW/DALLAS (Reuters) - President Barack Obama, seeking to soothe raw emotions after a former U.S. soldier killed five policemen in Dallas and high-profile police shootings of two black men in Minnesota and Louisiana, has urged Americans not to view the United States as being riven into opposing groups.

“First of all, as painful as this week has been, I firmly believe that America is not as divided as some have suggested,” Obama, who will cut short his European trip on Sunday to visit Dallas, told a weekend news conference in Warsaw.

“When we start suggesting that somehow there’s this enormous polarization, and we’re back to the situation in the ‘60s, that’s just not true,” Obama added. “You’re not seeing riots, and you’re not seeing police going after people who are protesting peacefully.”

Authorities named former U.S. Army Reserve soldier Micah Johnson, a 25-year-old African-American, as the lone gunman in Thursday night’s sniper attack in Dallas, which came at the end of a march by hundreds of demonstrators decrying the fatal police shootings of black men days earlier.

Officials said Johnson had embraced militant black nationalism and expressed anger over shootings by police as well as a desire to “kill white people, especially white officers.”

Dallas remained on edge on Saturday, with police headquarters and surrounding blocks cordoned off and SWAT teams deployed after police received an anonymous threat against officers across the city. Police searched a headquarters parking garage for a “suspicious person” but no suspect was found.

Thursday’s deadly rally in Dallas followed the fatal police shootings of Philando Castile, 32, near St. Paul, Minnesota, on Wednesday, and Alton Sterling, 37, in Baton Rouge, Louisiana, on Tuesday.

Obama said “Americans of all races and all backgrounds are rightly outraged by the inexcusable attacks on police, whether it’s in Dallas or any place else.”

He added they also are rightly saddened and angered about the deaths of Sterling and Castile, and about “the larger, persistent problem of African-Americans and Latinos being treated differently in our criminal justice system.”

Slideshow ( 8 images )

Obama, the first black U.S. president whose term in office ends next January, said he hopes he has been able to get all Americans to understand the nation’s difficult legacy of race.

Obama said Americans cannot let the actions of a few define all.

“The demented individual who carried out those attacks in Dallas - he’s no more representative of African-Americans than the shooter in Charleston was representative of white Americans, or the shooter in Orlando or San Bernardino were representative of Muslim-Americans,” Obama added, referring to a string of mass shootings in the past year.

Seven other police officers and two civilians were wounded in Dallas. Johnson was killed by a bomb-carrying robot deployed in a parking garage where he had holed up and refused to surrender during hours of negotiations with police.

PROTESTS CONTINUE

While Thursday’s attack stunned Dallas into mourning, it did not stop demonstrations on Saturday against killings by police, with protesters blocking major roads in various cities.

Hundreds of protesters shut down I-94, a major thoroughfare linking the Twin Cities of Minneapolis and St. Paul.

Protesters, warned to disperse, threw rocks, bottles, Molotov cocktails and construction rebar at officers, injuring at least three, St. Paul police said. Police began making arrests and used smoke bombs and marking rounds to disperse the crowd. Protesters at the scene said police fired tear gas and rubber bullets.

Slideshow ( 8 images )

In Baton Rouge, scuffles broke out between riot police and demonstrators. About 30 arrests were reported.

There were protests in other cities including Washington, San Francisco, Nashville, Tennessee, and Indianapolis, Indiana. About a thousand demonstrators turned out in New York, where they stymied traffic on busy Fifth Avenue and shouted chants such as “No racist police, no justice, no peace,” leading to about a dozen arrests.

Police use of force, particularly against African-Americans, has come under intense scrutiny in the past two years because of a string of high-profile deaths in cities from Ferguson, Missouri, to New York.

GUN CONTROL

Obama, who has been blocked by the Republican-led U.S. Congress in his bid for new gun-control measures, expressed new frustration over lax firearms laws in the United States, saying it is unique among advanced countries in the scale of violence it experiences.

“With respect to the issue of guns, I am going to keep on talking about the fact that we cannot eliminate all racial tension in our country overnight. We are not going to be able to identify ahead of time and eliminate every madman or troubled individual who might want to do harm against innocent people. But we can make it harder for them to do so,” Obama said.

Illustrating the divide among Americans over gun rights, Republican Texas Attorney General Ken Paxton told Reuters that men like the Dallas gunman “are not going to be confined by a gun law that we pass.”

Paxton, whose state has among the most permissive gun policies in America, added, “Our goal here in Texas is to protect law-abiding citizens. And since we cannot have a police force that guards every person, we want people to be able to protect themselves.”

Dallas Police Chief David Brown on Friday said the gunman cited his anger over police killings during his protracted negotiations with police after the shootings.

Johnson had served in the U.S. military in the Afghan war.

A search of his home just outside Dallas found bomb-making materials, ballistic vests, rifles, ammunition and a personal journal of combat tactics, though he had no previous criminal history, police said on Friday.