At least five police officers have been shot dead in the United States at protests over recent police killings of black men.
The Dallas Police Department said on Twitter: "It has been a devastating night. We are sad to report a fifth officer has died."
At least three of those killed were shot by what appeared to be sniper fire, police said.
The Dallas Morning News said that a suspect police had exchanged gunfire with in central Dallas at a car park was dead. CBS DFW, a local media outlet, said that the suspect killed himself.
Earlier, as he addressed the media, Dallas police chief David O Brown said the suspect "has told our negotiators that the end is coming and he's going to hurt and kill more of us, meaning law enforcement, and that there are bombs all over the place in this garage and downtown, so we are being very careful with our tactics."
Three other people were in custody, he said, including a woman.
"We still don't have a complete comfort level that we have all the suspects," Brown said.
Al Jazeera's Heidi Zhou-Castro, reporting from Dallas, said: "This [the standoff] is right in the heart of downtown Dallas. The march happened at what's called the Belo Garden Park. It's a little green space surrounded by tall office buildings where the communities have rallies of this type. The parking garage overlooks that park."
Gunfire broke out late on Thursday during an otherwise peaceful protest over two recent police killings of black men in Minnesota and Louisiana. The sound of gunfire sent marchers running and police scrambling for cover.
Reports said hundreds attended the protests.
Brown said two gunmen shot at police officers from "elevated positions", hitting at least 11 of them. At least three of the wounded were in a critical condition, he said.
'Vicious, calculated, despicable'
Firefighters and police were keeping people away as dozens of police cars with their lights flashing converged at the scene.
The Federal Aviation Administration issued a temporary flight restriction over the city.
US President Barack Obama, addressing the media in Warsaw where he is attending a NATO summit, called the incident a "vicious, calculated and despicable attack" for which there was "no possible justification".
"We need to be supportive of those officers who do their job every single day. Today is a wrenching reminder of the sacrifices they make for us. When people are armed with powerful weapons, it makes attacks like these more deadly and more tragic."
A day earlier, responding to the recent killings of black men by police, he said that all Americans should be concerned about racial disparities in the criminal justice system.
"I also said yesterday our police have an extremely difficult job and that the vast majority are doing their job in outstanding fashion," Obama said.
'Everyone started running'
"Everyone just started running," Devante Odom, 21, told The Dallas Morning News. "We lost touch with two of our friends just trying to get out of there."
Carlos Harris, who lives downtown, told the newspaper that the gunmen "were strategic. It was tap tap pause. Tap tap pause."
Video footage from the scene showed protesters marching along a street in the city centre, about half a mile from City Hall, when the shots erupted and the crowd scattered, seeking cover.
Brown, the police chief, said that it appeared the attackers "planned to injure and kill as many officers as they could".
Texas Governor Greg Abbott called for unity.
"In times like this we must remember - and emphasise - the importance of uniting as Americans," he said, in a statement.
The search stretched throughout downtown, an area of hotels, restaurants, businesses and some residential apartments. The scene was chaotic, with helicopters hovering overhead and officers with automatic rifles on the street corners.
'What do we want? Justice!'
The protests in Dallas were among several across the country that were held after a Minnesota officer on Wednesday fatally shot Philando Castile , a black American, while he was in a car with his partner Diamond Reynolds and her daughter in a St. Paul suburb.
Reynolds live streamed the aftermath of the shooting in a widely shared Facebook video.
A day earlier, Alton Sterling was shot in Louisiana after being pinned to the pavement by two white officers. That, too, was captured on a mobile phone video.
Other protests across the US on Thursday were peaceful.
In midtown Manhattan, protesters first gathered in Union Square Park where they chanted "The people united, never be divided!" and "What do we want? Justice! When do we want it? Now!"
In Minnesota, where Castile was shot, hundreds of protesters marched in the rain from a vigil to the governor's official residence. Protesters also marched in Atlanta, Chicago and Philadelphia.
Source: Al jazeera