Five police officers have been killed in a sniper attack in the city centre of Dallas - the deadliest day in US law enforcement since the September 11 terrorist attacks in 2001.
Here's everything you need to know about what happened:
12 police officers were shot.
Four city police officers and one officer with Dallas Area Rapid Transit, which operates buses and the state of Texas's largest municipal rail system, were killed in the attack.
Another seven officers were injured.
People were taking part in a protest against police violence at the time.
Hundreds had gathered to protest against the fatal shootings by police this week of Alton Sterling in Baton Rouge, Louisiana and Philando Castile in St Paul, Minnesota.
The gunfire then broke out at around 8.45pm local time.
The scene was chaotic as the police search got under way.
The search for the shooters stretched throughout the city centre, an area of hotels, restaurants, businesses and some residential apartments.
Helicopters hovered overhead and there were officers with automatic rifles on street corners of the area (which is a few blocks away from Dealey Plaza, where President John F Kennedy was assassinated in 1963).
Dallas Mayor Mike Rawlings said that authorities were asking people to stay away from the city centre: "This is still an active crime scene. We're determining how big that crime scene is."
He added that a map showing an area which people should avoid would be posted online.
A man was identified as a suspect on Twitter but later released.
The Dallas Police Department put out a photo on its Twitter account of a man wearing a camouflage shirt and holding a rifle with the message: "This is one of our suspects. Please help us find him!"
That man, Mark Hughes, told Dallas TV station KTVT that he "flagged down a police officer" immediately after finding out he was a suspect.
He said police lied during a 30-minute interrogation, telling him they had video of him shooting - even though videos posted online show Hughes walking around peacefully during the shooting and later turning over his gun to a police officer.
Police then named a suspect who told them he wanted to kill white people.
Officials have named a suspect as 25-year-old Micah Johnson, who died after a stand-off with police.
They also said that Johnson told officers he was upset over recent police shootings of black men and wanted to kill white people.
Police Chief David Brown said Johnson also told negotiators he was unaffiliated with any group and that he was acting alone - although that remains unclear.
Brown had said earlier that three other suspects were in custody, but he declined to discuss those detentions.
A few members of the public were also injured.
Brown told reporters snipers fired "ambush style" on the officers, and Rawlings said two members of the public were wounded in the gunfire.
Video footage from the scene showed protesters marching about half a mile from City Hall, when the shots erupted and the crowd scattered, seeking cover.
Barack Obama described the shootings as calculated and despicable.
Obama said America is horrified over the shootings and there was no possible justification for them, but added that all Americans should be troubled by frequent police shootings of blacks and Hispanics.
He said justice will be done and asked all Americans to pray for the fallen officers and their families. He also said the nation should express its gratitude to those serving in law enforcement.
The family of Alton Sterling have condemned the attack.
Quinyetta McMillon - the mother of Alton Sterling who was killed earlier in the week in Louisiana - said in a statement: "We wholeheartedly reject the reprehensible acts of violence that were perpetrated against members of the Dallas Police Department.
"Our hearts break for the families of the officers who were lost as they protected protesters and residents alike during a rally."