US President Barack Obama says America is "horrified" by what appears to be a planned sniper shooting targeting police officers in Dallas, Texas, adding there's no justification for the violence.
In a brief statement on Friday, Obama said the investigation into the shooting continues but "what we do know is there has been a vicious, calculated and despicable attack on law enforcement"..
Obama called the shooters motives "twisted" and vowed they would be brought to justice.
"There's no possible justification for these kinds of attacks or any violence against law enforcement," Obama said, noting that he had spoken with Dallas Mayor Mike Rawlings and offered his support and condolences.
Obama spoke from Warsaw, Poland, where he is meeting with NATO and European Union leaders.
Gunman dies after standoff with police
The suspect in the killing of five Dallas police officers has died after during a stand-off in a parking garage, local channel NBCDFW reports.
It was first reported that the suspect had been shot dead by police, but that was later called into doubt.
At the moment it is not known whether the suspect was shot dead by the police or he died from a self-inflicted gunshot wound.
The deceased was one of the alleged perpetrators of the attack on Thursday night in Dallas, Texas, on a peaceful Black Lives Matter rally against police violence.
Six police officers were wounded as was a civilian.
The suspect barricaded himself in a parking lot and continued to exchange gunfire with police officers during negotiations, and said "the end is coming".
He had vowed to hurt and kill more police. He also said he had placed several bombs in the parking lot and in other parts of downtown Dallas.
Apart from the deceased, three other suspects are being held in police custody, including a woman who was arrested near the garage and two others who were travelling in a Mercedes car.
According to NBCDFW, a large area of downtown Dallas is in lockdown and police are investigating two suspicious packages.
Two separate bomb disposal squads were deployed to the premises where the suspicious packages were found, according to the local TV channel.
The shootings, which the police called a "terrorist incident", took place as several hundred people marched through the Texan city to protest the fatal shootings this week of two black men by police in Louisiana and Minnesota.
As the rally was winding up, shots rang out around 9:00 pm (0200 GMT Friday), causing panic among the protesters, who scrambled to take cover.
City police chief David Brown said two snipers shot at the police "from elevated positions during the protest/rally". A civilian was also wounded.
Three others suspects were taken into custody - one woman and two men found with camouflage bags in a car.
"We still don't have a complete comfort level that we have all the suspects," Brown warned.
Another man turned himself into the police after the authorities tweeted a picture of him wearing camouflage and an assault rifle slung across his shoulder, with a call for information on his whereabouts.
It is legal for those with permits to openly carry weapons in the state of Texas. The man, named as Mark Hughes, was later released.
The shootings, which looked set to further strain race relations in the US, stunned the country.
One witness at the rally spoke of "complete pandemonium."
"There was blacks, whites, latinos, everybody. There was a mixed community here protesting. And this just came out of nowhere," Cory Hughes, a brother of the man who turned himself in and was cleared, told CNN.
"I'm still kind of startled, shaken up. As you know being in the front, it's almost like the gunshots were coming at us. It was complete pandemonium... It's bananas."

A Dallas Area Rapid Transit police officer receives comfort at the Baylor University Hospital emergency room entrance. Source: AAP
The protest was one of several nationwide over the fatal police shootings of black men in Minnesota and Louisiana this week that have prompted President Barack Obama to make an emotional appeal for urgent police reform.
The Federal Aviation Administration restricted use of the airspace over the city center until 1130 GMT, saying "only relief aircraft operations under direction of Dallas Police Department are authorized."
Rail and bus links were suspended in the downtown area of the usually bustling Texas city.

Dallas police respond after shots were fired during a protest over recent fatal shootings by police in Louisiana and Minnesota. Source: AAP
'Heartbreaking morning'
Mayor Mike Rawlings spoke of a "heartbreaking morning" for the city.
"We as a city, we as a country, must come together, lock arms and heal the wounds that we all feel from time to time. Words matter. Leadership matters at this time," he said.
Brown initially said two of the injured officers were undergoing surgery and three were in critical condition. The condition of the other officers was unclear.
Among the officers killed was Dallas Area Rapid Transit officer Brent Thompson, 43, the agency said, adding he was the first DART officer killed in the line of duty.
Dramatic video of the shooting emerged from witnesses, who posted the footage online. Bursts of gunfire and police sirens could be heard in the videos.
Ismael DeJesus, who filmed the attack while hiding in the Crown Plaza Hotel, described to CNN how one of the gunmen shot an officer on the ground.
"It looked like an execution, honestly. He stood over him after he was already down. Shot him maybe three or four more times in the back."
In another video, posted by Twitter user @allisongriz, one witness can be heard saying: "Oh, my God. There are people laying on the ground. I hope they're just hiding."
Facebook Live video captured gunfire battle
A Facebook Live video shot by Michael Kevin Bautista shows police officers sheltering behind police cars as multiple shots can be heard.
In an interview also broadcast on Facebook Live, Mr Bautista told a reporter bullets had started flying past him as he walked back to his car at the end of the rally.
"It started out very subtle and then it went up to more of a barrage of gun fire," he said.
"I ran across the street past the line of gun fire.
"The police told me to get down because they were shooting this way, which I already knew because I saw the bullets ricocheting off the police cars."
The gunfire broke out around 8.45pm Thursday (local time).
Live TV video shows protesters marching along a downtown Dallas street when the shots erupted and the crowd scattered, seeking cover.
Scores of police and security officers were on hand. Officers and other people hunched behind cars outside a parking garage.
Officers with guns drawn were running near and into the parking garage as police searched for the shooter.
A police dispatcher reached by The Associated Press had no immediate comment while a spokesman for the mayor said he no information he could share.
Firefighters and police at the scene were keeping people away.
"Everyone just started running," Devante Odom, 21, told The Dallas Morning News.

Bystanders run for cover after shots fired at a Black Live Matter rally in downtown Dallas. Source: AAP
"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 shooters "were strategic".
"It was tap tap pause. Tap tap pause."
The gunshots in Dallas come amid nationwide protests over the recent police shootings.
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!".
A group of protesters then left the park and began marching up Fifth Avenue blocking traffic during the height of rush hour as police scrambled to keep up.
Another group headed through Herald Square and Times Square where several arrests were reported.
Michael Houston, a 20-year-old Brooklyn student, said anger and lack of action brought him to the protest.
"It's the definition of insanity," Houston said.
"How can we expect anything to be different when nothing changes."
Lawrence Amsterdam, 35, another student from Brooklyn, decried what he called the police injustice.
"It's supposed to be innocent until proven guilty. But the way I see it, it's murder first and ask questions later," he said.
On Wednesday, a Minnesota officer fatally shot Philando Castile while he was in a car with a woman and a child in a St. Paul suburb.
The aftermath of the shooting was purportedly livestreamed 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.
Prior to the shooting the protest had been peaceful, with Dallas Police following the march, tweeting videos and even posing for photographs with protesters.