ABC News July 10, 2016

Dallas Shooter Planned Attack for Months, Took 'Opportunity' of Protests, Judge Says

WATCH: Dallas Ambush Gunman May Have Had More Ambitious Plans

Micah Johnson had planned his sniper attack on Dallas police for months and practiced combat tactics in preparation, a Dallas official said today.

Johnson opened fire on police during a peaceful Black Lives Matter demonstration Thursday night, when marchers were protesting the fatal shootings of two black men by police officers, one in Minnesota and the other in Louisiana. He killed five police officers and wounded nine others.

Dallas County Chief Executive Judge Clay Jenkins said Johnson had been planning and training, and took advantage of the protest because of the high police presence.

"He knew police would be amassing at that scene and he used it as an opportunity to shoot," Jenkins said.

Mother Who Shielded Her Sons During Dallas Shooting Thanks Police 'Heroes' Obama to Meet With Families of Slain Police During Dallas Visit President Obama Warns 'Hostile' Rhetoric Against Police Hurts Reform Efforts

Johnson had two weapons, both purchased legally -- an SKS rifle and a handgun -- and was prepared with many magazines for the rifle, the judge said.

Law enforcement officials say Johnson, an Army vet, used his military training in carrying out the attack.

Johnson found a spot in a parking garage at about 9 p.m., overlooking an area where police were hemmed in by protesters, and opened fire.

Police were eventually able to trap Johnson on the second floor of the El Centro College building, which Jenkins said had been put on lockdown when the shooting started.

For two hours, police tried to negotiate with Johnson, but Dallas Police Chief David Brown told CNN today that "he basically lied to us, playing games, laughing at us, singing, asking how many did he get and that he wanted to kill some more."

But all that time, Johnson was wounded, and he used his own blood to start to write something on the wall of the room where he was holed up, Jenkins said.

"We believe that he was wounded as he was going up the stairs," said Jenkins. "We believe he wrote in his own blood on the wall."

Brown finally ordered the SWAT team to send in a bomb-carrying robot to kill Johnson, and it was detonated at 1:31 a.m.

Law enforcement experts say it appears to be the first time such a robot was used to kill a suspect, and questions have been raised about the ethics of the move, but Jenkins echoed Brown's defense of the decision.

"I do believe it was warranted because it saved lives," he said.

Because the college was on lockdown, there were other people in the building when the bomb was detonated, but they were all unharmed when they were evacuated later, he said. He said the charge used was small enough that it would not have hurt anyone but the suspect.