Austin, TX - The man charged with fatally shooting a Houston-area deputy in a hail of gunfire spent four months in a mental hospital in 2012 after being declared incompetent to stand trial in an aggravated assault case, the Houston Chronicle reported on Tuesday.

Shannon Miles, 30, has been charged with capital murder, a crime punishable by death in Texas, accused of emptying a 15-round handgun into Harris Count Deputy Darren Goforth on Friday evening as the lawman fueled a patrol car at a Houston-area gas station.

In 2012 when Miles was staying in Austin, he was accused of beating up a man at a Salvation Army shelter in an attack that left the victim with a broken vertebrae, the Chronicle said, citing court records.

Miles was declared mentally incompetent and sent to the North Texas State Hospital. The case was eventually dismissed, the newspaper said.

Miles appeared in court on Monday for an arraignment in the murder case and did not enter a plea.

Deputies found Goforth face down in a pool of blood near his patrol car, dead from multiple gunshot wounds to the back, with 15 .40-caliber shell casings around him, Harris County District Attorney Devon Anderson said in court.

Deputies found a loaded .40-caliber gun in Miles’ garage and the same brand of ammunition as the casings found at the gas station, Anderson said. Forensic tests determined the gun was the one fired at the scene, she said.

A witness identified Miles in a lineup as the shooter, Anderson said.

The slaying came as police handling of minority suspects has become a national issue. Harris County Sheriff Ron Hickman said on Saturday the department assumed Goforth was a target because he wore a uniform.