At least one sniper in Dallas killed five police officers and wounded seven more in a coordinated attack that ended when police used a bomb to kill a shooter who told them he wanted to kill white officers, authorities said Friday.
The attack came during one of several protests across the United States against the killing of two black men by police this week, the latest in a long string of killings that gave rise to the Black Lives Matter movement.
Police described Thursday night's ambush as carefully planned and executed and said they had taken three people into custody before killing the fourth after a long standoff in a downtown garage.
"We had an exchange of gunfire with the suspect. We saw no other option but to use our bomb robot," Dallas Police Chief David Brown told reporters at City Hall.
"The suspect said he was upset about Black Lives Matter," said Brown, who is black. "He said he was upset about the recent police shootings. The suspect said he was upset at white people. The suspect stated that he wanted to kill white people, especially white officers."
The attack came in a week that two black men were fatally shot by police officers in Baton Rouge, Louisiana, and outside Minneapolis. The killings, both now the subject of official investigations, inflamed tensions about race and justice in the United States.
The shots rang out as a protest in Dallas was winding down, sending marchers screaming and running in panic through the city's streets.
It was the deadliest day for police in the United States since the Sept. 11, 2001, attacks on New York and Washington.
A total of 12 police officers and two civilians were shot during the attack, Dallas Mayor Mike Rawlings said. Three of the officers who were shot were women, he said.
Rawlings told CBS News the people in custody, including one woman, were "not being cooperative" with police investigators. He said the assailant who was dead was being fingerprinted and his identity checked with federal authorities.
Police were still not certain they knew all of the individuals involved in the attack, Rawlings said.
There was no sign of international links to the attacks, U.S. officials said on Friday.
One of the dead officers was identified as Brent Thompson, 43. He was the first officer killed in the line of duty since Dallas Area Rapid Transit formed a police department in 1989, DART said on its website. Thompson joined DART in 2009.
Earlier, Brown said the shooters, some in elevated positions, used rifles to fire at the officers in what appeared to be a coordinated attack.
"(They were) working together with rifles, triangulating at elevated positions in different points in the downtown area where the march ended up going," Brown told a news conference, adding a civilian was also wounded.
A video taken by a witness shows a man with a rifle crouching at ground level and shooting a person who appeared to be wearing a uniform at close range. That person then collapsed to the ground.
Reuters could not immediately confirm the authenticity of the video.
President Barack Obama, who was traveling in Poland, expressed his "deepest condolences" to Rawlings on behalf of the American people.
"I believe I speak for every single American when I say that we are horrified over these events and we are united with the people and police department in Dallas," he said.
Obama said the FBI was in contact with Dallas police and that the federal government would provide assistance.
"We still don't know all of the facts. What we do know is that there has been a vicious, calculated and despicable attack on law enforcement," he said.
The shooting, which erupted shortly before 9 p.m. CDT (0100 GMT), occurred near a busy area of downtown Dallas filled with restaurants, hotels and government buildings.
Mayor Rawlings advised people to stay away on Friday morning as police combed the area. Transportation was halted and federal authorities stopped commercial air traffic over the area as police helicopters hovered.
The Dallas-Fort Worth metropolitan area is one of the nation's most populous and is home to more than 7 million people.
The Dallas shooting happened as otherwise largely peaceful protests unfolded around the United States after the police shooting of Philando Castile, a 32-year-old black man, on Wednesday during a traffic stop near St. Paul, Minnesota.
The day earlier, police in Baton Rouge shot dead another black man, Alton Sterling, 37, while responding to a call alleging he had threatened someone with a gun.
Over the last two years, there have been periodic and sometimes violent protests over the use of police force against African-Americans in cities from Ferguson, Missouri, to Baltimore and New York. Anger has intensified when the officers were acquitted in trials or not charged at all.
'THE END IS COMING'
The suspect in the Dallas standoff had told police "the end is coming" and that more police were going to be hurt and killed. Police chief Brown said the suspect also told police "there are bombs all over the place in this garage and downtown".
Police said they were questioning two occupants of a Mercedes they had pulled over after the vehicle sped off on a downtown street with a man who threw a camouflaged bag inside the back of the car. A woman was also taken into custody near the garage where the standoff was taking place.
"We are leaving every motive on the table on why this happened and how this happened," Brown said.
Mayor Rawlings visited the wounded at Parkland hospital, the same hospital where President John F. Kennedy was taken after he was shot in Dallas in November 1963.
Outside the hospital, officers stood in formation and saluted as bodies of the officers were about to be transported.