President Barack Obama says he believes "America is not as divided as some have suggested" following fatal police shootings of African-Americans and an ambush that left five policemen dead in Dallas.
He called the Dallas shooter a "demented individual." The Dallas shooter is not representative of Blacks, and the man who killed people at a historic African American church last year in Charleston is not representative of whites, Obama said.
On the issue of guns specifically, in response to a question, Obama said "I am not going to stop talking about guns because they are part of the problem."
Obama was speaking in Poland at a NATO summit. He is cutting his trip to Europe short by one day and will return to Washington on Sunday night.
U.S. Homeland Security Secretary Jeh Johnson on Friday also said the shooter had no known links to international terrorist organizations. He added, "Violence is never the answer. Violence directed at our police officers is never the answer."
Dallas Mayor Mike Rawlings confirmed that the killing of five police officers in the Texas city on Thursday was carried out by a lone gunman, identified as Micah Johnson.
WATCH: Obama speaks about U.S. violence at NATO summit
Texas Governor Greg Abbott said law enforcement officers would investigate and determine whether any co-conspirators or other suspects may have helped him. He added, "We need to focus on the imperative of unity: that we unite all citizens of Dallas, all citizens of Texas."
Suspect's home searched
During a search of Johnson's home on Friday, Dallas police detectives found bomb-making materials, ballistic vests, rifles, ammunition and a personal journal of combat tactics, the police department said in a statement.
Police Chief David Brown on Friday described the previous night's deadly sniper attack as "well-planned" and a "well thought-out evil tragedy."
The attack, which city officials labeled an "ambush," happened toward the end of a demonstration against the killing of two black men by white police officers in Minnesota and Louisiana earlier this past week.
Johnson, cornered by police after the ambush, told a negotiator he was "upset" about recent police shootings and wanted "to kill white people, especially white [police] officers," Brown related during a Friday news conference. The gunman also said he was acting alone and was unaffiliated with any groups.
He told police they would eventually find bombs planted in the city; a suspicious package has been secured by the city's bomb squad near the attack site.
After talks with Johnson broke down, police used a bomb robot to detonate an unspecified explosive device near him, the police chief said. The gunman was killed.
The U.S. military has confirmed Johnson was a former Army Reservist who served in Afghanistan.
Seven other police officers and two civilians were wounded in the attack, Dallas' mayor said Friday morning. The attack was the deadliest day for U.S. law enforcement since the terror attacks of September 11, 2001.
Police initially thought there were at least two snipers.
Mayor Rawlings said up to 20 people in the crowd at the protest were wearing camouflage gear and body armor and carrying rifles, which are legal to carry in Texas.
"When the gunman started firing and people started running, we saw those people carrying guns start to run," Rawlings said. That led police to believe more people were involved in the attack.
Video footage of the shootings shared on social media showed people fleeing the sound of semiautomatic gunfire. One recording showed a gunman shooting an officer.
Police had issued a photograph of an armed black man in camouflage dress who attended the demonstration as "a person of interest" in Thursday's shooting. The man later turned himself in to authorities, who determined he was not involved in the shootings.
WATCH: What led to attack on Dallas police
Nearly 1,000 people attended the Thursday Dallas rally to protest the shooting deaths of two men in Minnesota and Louisiana by police officers earlier this week. Both incidents, captured on video, led to demonstrations in many U.S. cities. The U.S. Justice Department has opened a civil rights investigation into the Louisiana case.
Alton Sterling, 37, was fatally shot Tuesday outside a convenience store in Baton Rouge, Louisiana; Philando Castile was killed at close range during a traffic stop Wednesday in St. Paul, Minnesota, as his girlfriend and her 4-year-old daughter sat in the car with him.
Louisiana, Minnesota shootings
Quinyetta McMillon, the mother of one of Sterling's children, issued a statement Friday denouncing the Dallas police killings.
"We wholeheartedly reject the reprehensible acts of violence that were perpetrated against members of the Dallas Police Department,'' the statement said. "Our hearts break for the families of the officers who were lost as they protected protesters and residents alike during a rally.''
The shooting deaths of Sterling and Castile are the latest incidents in a string of police shootings in the United States that are widely viewed as examples of police using excessive force against minorities.
The Washington Post, which last year began tracking the number of people fatally shot by police, reports 509 deaths so far this year – an increase of 27 over the same period last year.
In response to the deaths of Sterling and Castile, protesters rallied around the Black Lives Matter campaign across the country this past week to counter what they see as disproportionate police violence against minorities.
Lily Reagan and Kenneth McCarroll pray at Cathedral Guadalupe in Dallas, in honor of the police officers slain Thursday.
A number of prayer vigils were held in American cities to remember those lost in this week's tragic events.
Friday evening, African-American and white church members held a vigil at a local church called Together We Stand. "The senseless killing has to stop, and understanding has to begin, and you can’t have that without dialogue," said Dallas business analyst Lou-Ann Phillips, an African-American.
"Obviously, we’re concerned about the officers and their families, but we’re also concerned about other Americans that feel that their liberties have not been protected the way they should by police officers," said local Dallas church member Michael Young.
Gary Brandenbrug, a white pastor from the Fellowship Bible Church, said "it just takes one person that has twisted motives and a tortured soul and the next thing you know, the whole city’s grieving."
Internationally, U.N. Secretary General Ban Ki-moon condemned the police killings in Dallas, saying "there is no justification for such violence." Through a spokesman, he said the Thursday attack "compounded the suffering that many in the United States feel following the killing of two African-American men over two days.”
Ban also called for a “thorough and impartial” investigation into the deaths of Sterling and Castile and said the United States needs to "address discrimination, including racial disparities in law enforcement."
Other international leaders expressed condolences for the Dallas police shootings. "Canadians are shocked by the cowardly attacks against police in Dallas," Canadian Prime Minister Justin Trudeau wrote on Twitter. "Our solidarity is with all victims of violence on this tragic week.”
European Council President Donald Tusk tweeted he was “deeply sorry” about the shootings. “We are with you in this as well as with families and loved ones of victims,” he wrote.
VOA National Security Correspondent Jeff Seldin contributed to this report from Washington.