At least one sniper killed five Dallas police officers and wounded another seven in a racially charged attack that ended when police used a robot carrying a bomb to kill him, the city's shaken police chief said on Friday.
The incident began on Thursday evening at the end of a protest over this week's killing of two black men by local police in the United States.
The shooting sent protesters running in panic while swarms of police found themselves under attack by what they believed to be multiple gunmen using high-powered rifles at ground level and on rooftops.
During lengthy negotiations with police, the gunman said he had wanted to kill white people and white police officers and was angry about the recent shootings. He cited the "Black Lives Matter" anti-police-violence movement, but also said he was not part of a larger organization, said Dallas Police Chief David Brown.
"We had an exchange of gunfire with the suspect. We saw no other option but to use our bomb robot," Brown told reporters at City Hall.
This week's killings of black men by police officers in Baton Rouge, Louisiana, and outside Minneapolis were the latest in a long string of similar, controversial killings that have led to almost two years of national protests over race and justice. The latest deaths are both being investigated by federal authorities.
"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."
U.S. media identified the suspect as Micah X. Johnson, a 25-year-old resident of the Dallas area, citing unnamed law enforcement sources.
Quinyetta McMillon, who had a child with Alton Sterling, the black man slain by police in Baton Rouge, Louisiana, earlier this week, condemned the Dallas attack in a statement.
"We wholeheartedly reject the reprehensible acts of violence that were perpetrated against members of the Dallas Police Department," McMillon said. "Regardless of how angry or upset people may be, resorting to this kind of sickening violence should never happen and simply cannot be tolerated."
A Twitter account describing itself as representing the Black Lives Matter movement sent the message: "Black Lives Matter advocates dignity, justice and freedom. Not murder."
With Thursday's attack, 26 police officers have been shot and killed in the United States so far this year, according to the National Law Enforcement Officers Memorial Fund. That is up 44 percent from the 18 officers slain in the same period in 2015, the group said.
Some of the largest police forces in the United States were on high alert on Friday, following the attacks in Dallas, with departments in New York and Boston ordering officers to patrol in pairs.
Panic in the streets
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.
Shooters, some in elevated positions, used rifles to fire at the officers in what appeared to be a coordinated attack, Brown said.
A DART (Dallas Area Rapid Transit) police officer at the Baylor University Hospital emergency room entrance in Dallas. Ting Shen/The Dallas Morning News/Handout via REUTERS.
"(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.
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.
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.
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.
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.
Brown declined to say how many people were involved in the attack, saying, "We're going to keep these suspects guessing."
Experts on extremist groups said such attacks are not necessarily carried out by an organization and are often the work of individuals. Black groups have not been linked to any recent violent attacks in the United States, they said.
"Most extremists are not card-carrying members of any groups whatsoever," said Mark Pitcavage, an expert on extremist movements with the Anti-Defamation League. "Especially in this internet age, it is easy to get involved in an ideology without joining a group."
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 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 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.
Dallas is a pioneer in training its police officers in de-escalation techniques, Rawlings told reporters, saying the department had the lowest number of police-involved shootings of any large American city.
'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 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.
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.
Presidential candidates Republican Donald Trump and Democrat Hillary Clinton canceled planned events following the attack.
"Our nation has become too divided. Too many Americans feel like they've lost hope," Trump said in a statement. "This is a time, perhaps more than ever, for strong leadership, love and compassion."
Clinton said on Twitter: "I mourn for the officers shot while doing their sacred duty to protect peaceful protesters, for their families & all who serve with them."