Police say that the man charged with killing two NYPD officers had a troubled history of violence and instability, along with multiple run-ins with the law.

Ismaaiyl Brinsley, 28, has been identified as the man who fatally shot officers Wenjian Liu, 32, and Rafael Ramos, 40, Saturday afternoon as they were sitting in a police car in Brooklyn. Brinsely then took off and pulled the trigger on himself in a nearby subway station.

Earlier that day, he shot his ex-girlfriend in the stomach in her Maryland home before he drove to New York City with the intent to murder police officers. 

Leading up to the shooting, the New York Police Department's Chief of Detectives Robert Boyce said Brinsley had posted anti-police and anti-government messages on his Instagram account in light of the deaths of Michael Brown and Eric Garner, two unarmed African American men who were killed by police. However, neither cop was charged in their deaths.

Hours after shooting his ex-girlfriend, Brinsley posted a threat to kill police officers on his Instagram page, writing: "They Take 1 of Ours... Let's Take 2 of Theirs #ShootThePolice #RIPEricGarner #RIPMike Brown. This May Be My Final Post," reports BBC News.

Chief Boyce said Brinsley had also expressed feelings of "self-despair and anger at himself and where his life was" in recent posts. 

Meanwhile, Boyce said that his mother stated that her son had a "very troubled childhood" and had previously tried to kill himself.

"The mother expressed fear of him, and she said she hasn't seen him in one month," Boyce said, adding that he was estranged from his family. "Brinsley attempted suicide in the past and attempted to hang himself a year ago."

Boyce also talked about Brinsley's long criminal history, which included 15 arrests in Georgia for misdemeanor assault, shoplifting, grand larceny and gun possession. In addition, Brinsley was arrested four times in Ohio for robbery and misdemeanor theft. Furthermore, he spent two years in prison from 2011 to 2013 for criminal possession of a weapon. Court records show that he admitted to spending time in a mental institution or under the care of a psychiatrist during one of his plea deals in 2011, reports the New York Daily News.

The detective also indicated that Brinsley may have had a potential undiagnosed mental health issue.

"He may have been on meds later on in life, but not early in life," Boyce said. "I have no reports of mental history yet from our investigation. That doesn't mean it won't come."

He added that he did not have any gang affiliations or links to extremist groups.

"We were told by family members that he's never expressed any radicalization at all," he said, according to the Washington Post. "This is a Muslim family. His mother goes on to state, he had a very troubled childhood and was often violent. Mother expressed fear of him and she says she hasn't seen him in one month."