Gavin Eugene Long, baton rouge police killings
Gavin Long, the man who killed three law enforcement officers in Baton Rouge, Louisiana, before a SWAT team officer shot him dead -- told friends and relatives that he suffered from post-traumatic stress disorder, a source involved in the investigation told CNN's Chris Cuomo.

Long joined the Marine Corps in 2005, worked as a data network specialist and served in Iraq before being discharged as a sergeant in 2010, according to the U.S. military.

Long had filled a prescription for Ativan, an anti-anxiety drug, as recently as June, said the source, who spoke on condition of anonymity. He also had prescriptions for Valium and the sleep aid Lunesta, the source said.

It wasn't immediately clear whether anyone had diagnosed him with PTSD. CNN has filed a Freedom of Information Act request with the military to obtain records about Long's service. Under Defense Department rules, health records that might include any information on Long's mental health are considered protected, even though he is dead. The records are part of the criminal investigation.

Valium, like Ativan, is a benzodiazepine -- a class of medication with sedative properties that are prescribed for anxiety, insomnia and other conditions.

Sunday's ambush of police by Long, a 29-year-old black man, came nearly two weeks after a police officer shot and killed Alton Sterling, a black Baton Rouge resident outside a convenience store in the city on July 5.

His shooting kicked off days of national turmoil. Sterling's death and a July 6 shooting of a black man by police in Minnesota spurred nationwide protests. During one of those protests on the night of July 7, a gunman shot and killed five police officers in Dallas.

One officer still in critical condition

Police say Long, of Kansas City, Missouri, stalked Baton Rouge officers on Sunday before shooting six officers in an ambush, killing three -- Baton Rouge police Officers Montrell Jackson and Matthew Gerald and East Baton Rouge sheriff's Deputy Brad Garafola -- and wounding three others.

A SWAT team rifleman subsequently shot and killed Long with a shot from 100 yards away, police said.

"There is no doubt whatsoever that these officers were targeted and assassinated," Louisiana State Police Col. Michael D. Edmonson said Monday. One of the three injured officers, Deputy Nicholas Tullier, was critically wounded and "fighting for his life," Sheriff Sid Gautreaux said Sunday.

Long apparently visited Dallas after the shootings there, posting a YouTube video July 10 in which he said he was in the Texas city and spoke of the recent protests and officer-involved shootings.In the video, Long mentions the July Fourth holiday as a celebration of an uprising against oppressive forces. Without mentioning Micah Xavier Johnson -- the Dallas shooter -- by name, he questions why some violent actions are perceived as criminal while others are celebrated.

He also said that victims of bullying need to resort to brute force. "One-hundred percent have been successful through fighting back. Through bloodshed," he said in the video. "Zero have been successful just over simply protesting. It has never worked, and it never will."

He left a trail of writings, videos and social media posts describing his thoughts, ideas and worldview under the pseudonym Cosmo Setepenra. He legally changed his name to Setepenra last year.Long rented a car in Kansas City after the Dallas shootings and eventually drove it to Baton Rouge, two law enforcement sources told CNN. Like Long, Dallas shooter Johnson had military ties, having been an Army reservist. Dallas police Chief David Brown said Johnson, a black man, had expressed that he was upset about recent police shootings, wanted to kill white people and white police officers, and "expressed anger for Black Lives Matter."

Johnson was killed by a bomb-carrying police robot on the night of the Dallas attack after failed negotiations, police said.