The Dallas sniper had been sent home from Afghanistan after being accused of sexually harassing a female, and was described as a loner who followed black militant groups on social media.
Micah Xavier Johnson, who fatally shot five officers and wounded seven more before police killed him with a remote-controlled bomb on Friday, lived with family members in the blue-collar suburb of Mesquite, where he played basketball for hours at a time.
Friends there said the 25-year-old black man didn't seem interested in politics, but his Facebook page suggests otherwise: He "liked" black militant groups including the African American Defense League and the New Black Panther Party, which was founded in Dallas.
His photo showed him wearing a dashiki and raising his fist over the words "Black Power", and his cover shot carried the red, black and green Pan-African flag.
For six years from 2009, Johnson served in the Army Reserve as a private first class with a specialty in carpentry and masonry, the military said.
In May 2014, six months into his Afghanistan tour, he was accused of sexual harassment by a female soldier. The army sent him stateside, recommending an "other than honourable discharge", said Bradford Glendening, the military lawyer who represented him.
That recommendation was "highly unusual", Bradford said, since counselling is usually ordered before more drastic steps are taken.
"In his case, it was apparently so egregious, it was not just the act itself," Glendening told the Associated Press. "I'm sure that this guy was the black sheep of his unit."
Glendening said Johnson was set to be removed from the army in September 2014 because of the incident, but instead got an honourable discharge months later - for reasons he can't understand.
When authorities searched Johnson's home on Friday they found bomb-making materials, ballistic vests, rifles, ammunition, and a personal journal of combat tactics.
Dallas Police Chief David O Brown said Johnson told negotiators before he was killed that he was acting alone and was unaffiliated with any group.
The chief said Johnson cited the fatal shootings of black men by police officers in Louisiana and Minnesota, which prompted the protest march in Dallas and many other cities.
"The suspect said he was upset with white people and wanted to kill white people, especially white officers," Brown said.
Activists with Black Lives Matter, whose peaceful march police were guarding as he opened fire, repudiated the shootings, and it wasn't immediately clear if Johnson had any connection to the movement, which has disavowed violence.
But one of the groups Johnson "liked" on Facebook, the African American Defense League, posted a message earlier in the week encouraging violence against police in response to the killing in Louisiana.
"The Pig has shot and killed Alton Sterling in Baton Rouge, Louisiana! You and I know what we must do and I don't mean marching, making a lot of noise, or attending conventions. We must 'Rally The Troops!' It is time to visit Louisiana and hold a barbeque."