President Obama told a memorial service for the five Dallas police officers killed by a sniper, that the force needs respect, and not scorn.
The President, in Texas with his predecessor George W Bush, praised the police's bravery, saying the "overwhelming majority" do their jobs "fairly and professionally".
But he admitted that people across the country were struggling with the recent shootings and that racism was an enduring problem in America.
Our Washington Correspondent Robert Moore reports:
The father of Dallas shooting victim police officer Patrick Zamarripa said he was 'angry' about his son's death, but called for more unity.Read the full story ›
A man who attacked Dallas Police headquarters and sprayed the building with bullets during a wild street battle before being killed by a police sniper had blamed police over losing custody of his son.
Dallas Police chief David Brown said the suspect identified himself to authorities as James Boulware, and he blamed police for having lost custody of his son and for "accusing him of being a terrorist".
Officials declined to officially identify the suspect until a coroner verified it.
Boulware's father, who said his son had strong feelings against law enforcement after he lost custody of his son, now 12 or 13 years old, last spoke with him by telephone about three hours before Dallas Police said the shooting began.
"Not being able to get a job and the legal system letting him down, (he) finally snapped," the elder James Boulware said in a telephone interview before police arrived. "But I can't say shooting at a police station is right in any way."
Dallas Police has officially confirmed the suspect in a shootout at its headquarters has been killed:
Official reports also confirmed that two "additional pipe bombs" had been discovered in the suspect's van after bomb technicians were able to safely approach and investigate the vehicle:
Pictures showing the aftermath of a shootout at Dallas Police headquarters have shown the damage caused by the gunman's attack.
In the pictures, posted on Texas Police Major Max Geron's Twitter account, bullet holes can be seen in windows and walls of the first and second floors of the building:
Dallas Police have said it is "likely" the suspect in a shootout at the city's police HQ is dead:
There has been no contact with the suspect in over 4 hours - believe it likely that he is deceased #DallasPDShooting
The suspect was shot by Swat snipers after police chased his van to a nearby fast-food restaurant's carpark following the shootout at the police station.
Dallas police department have confirmed that "there are no injured officers" following a shootout outside the department's HQ in the early hours of this morning:
The suspect, shot by Swat snipers outside a fast-food restaurant several hours after the initial police HQ shootout, has not yet been identified. Officers are currently trying to gain access to the van the suspect was driving to make an official identification.
Police officials believe the suspect in a shootout at Dallas Police headquarters "meant to kill officers" as he fired at the building in the early hours of this morning.
Speaking at a news conference a police spokesman said: "We believe this suspect meant to kill officers and took time to discharge that weapon multiple times to accomplish their wanting to harm our officers.
"When the van rammed the squad car that initially confronted this suspect seconds of movements by our officers, seconds, saved their lives. If they had stood still and not moved and shot in response they wouldn't have survived."
Stating that Dallas police force had been "blessed that our officers survived this ordeal" the official detailed how bullet holes had been found in cars where staff were sitting, and the lobby where staff were sitting, following the shooting.
The official also confirmed bomb squads were coordinating operations at the last known address of the suspect and the police HQ was now classed as a crime scene.
Officers involved in a shootout at Dallas Police headquarters are reportedly not approaching the vehicle the alleged gunman was travelling in as the suspect told officers the van was "rigged with explosives".
A Dallas Police spokesman said the planned detonation of the van will be undertaken by bomb technicians:
A Dallas Police spokesman has said a bag of explosives placed outside the city's police HQ exploded as the robot sent in to detonate the package attempted to retrieve it.
He said : "As the robot picked up the bag the bag exploded, detonated."