BATON ROUGE, LA - JULY 17:  Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police.  (Photo by Sean Gardner/Getty Images)
Sean Gardner/Getty Images
BATON ROUGE, LA - JULY 17: Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police. (Photo by Sean Gardner/Getty Images)
Now playing
01:09
Baton Rouge shooter was a former Marine
EBRDA Videos
Now playing
01:24
New video from Baton Rouge police ambush
baton rouge shooting timeline nick valencia dnt_00003328.jpg
baton rouge shooting timeline nick valencia dnt_00003328.jpg
Now playing
01:38
How the Baton Rouge shooting went down
BATON ROUGE, LA - JULY 17:  East Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police.  (Photo by Sean Gardner/Getty Images)
Sean Gardner/Getty Images North America/Getty Images
BATON ROUGE, LA - JULY 17: East Baton Rouge Police officers patrol Airline Hwy after 3 police officers were killed early this morning on July 17, 2016 in Baton Rouge, Louisiana. According to reports, one suspect has been killed while others are still being sought by police. (Photo by Sean Gardner/Getty Images)
Now playing
00:55
Source: Baton Rouge shooter identified
Montrell Jackson slain Baton Rouge officer
Facebook
Montrell Jackson slain Baton Rouge officer
Now playing
01:42
Slain Baton Rouge officer had written emotional post
Governor Louisiana Baton Rouge ambush police killed presser_00004906.jpg
WAFB
Governor Louisiana Baton Rouge ambush police killed presser_00004906.jpg
Now playing
01:20
Governor: The hatred just has to stop
Police gave the name of the man who shot 6 police officers in Baton Rouge on July 17 as Gavin Long. Online, he used the name "Cosmo Setepenra," and posted on a YouTube channel of that name.
YouTube/Cosmo Setepenra
Police gave the name of the man who shot 6 police officers in Baton Rouge on July 17 as Gavin Long. Online, he used the name "Cosmo Setepenra," and posted on a YouTube channel of that name.
Now playing
01:14
Baton Rouge gunman posted this video on social media
Jada Gabriel
Now playing
01:08
New video of gunfire exchange in Baton Rouge
baton rouge police shooting witness bpr_00000000.jpg
WAFB
baton rouge police shooting witness bpr_00000000.jpg
Now playing
02:10
Witness describes Baton Rouge police shootout scene
Superintendent no active shooter Baton Rouge_00002421.jpg
WAFB
Superintendent no active shooter Baton Rouge_00002421.jpg
Now playing
02:26
Police: No active shooter situation in Baton Rouge
Obama Baton Rouge shooting_00043225.jpg
Obama Baton Rouge shooting_00043225.jpg
Now playing
05:00
Obama speaks out on Baton Rouge police shooting
baton rouge pastor mark burns ebof_00001819.jpg
baton rouge pastor mark burns ebof_00001819.jpg
Now playing
01:20
Pastor Mark Burns calls Baton Rouge shooting a tragedy
Authorities talk to the driver of a car near an area where several officers were shot while on duty less than a mile from police headquarters, Sunday, July 17, 2016, in Baton Rouge, La. (AP Photo/Mike Kunzelman)
Mike Kunzelman/AP
Authorities talk to the driver of a car near an area where several officers were shot while on duty less than a mile from police headquarters, Sunday, July 17, 2016, in Baton Rouge, La. (AP Photo/Mike Kunzelman)
Now playing
03:05
Police: Scene active but contained
Now playing
02:02
Van Jones: Cops, blacks both feel targeted
FILE - In this June 25, 2010, file photo Britain's Prince Harry fires a Colt M4 assault riffle on a United States Military Academy range in West Point, N.Y.  The Defense Department is searching for the successor to the M4 combat rifle and gun makers are loading with lobbyists to win the work. Colt Defense of West Hartford, Conn., had an exclusive deal to provide M4s to the U.S. military and didnt need a hired gun looking out for its interests in Washington. (AP Photo/Chad Rachman, Pool, File)
Chad Rachman/POOL NEW YORK POST/ASSOCIATED PRESS
FILE - In this June 25, 2010, file photo Britain's Prince Harry fires a Colt M4 assault riffle on a United States Military Academy range in West Point, N.Y. The Defense Department is searching for the successor to the M4 combat rifle and gun makers are loading with lobbyists to win the work. Colt Defense of West Hartford, Conn., had an exclusive deal to provide M4s to the U.S. military and didnt need a hired gun looking out for its interests in Washington. (AP Photo/Chad Rachman, Pool, File)
Now playing
01:40
History of the modern assault-style rifle

Story highlights

Ex-Marine who killed three officers in Baton Rouge served a tour in Iraq

He had filled prescriptions for anti-depressants and a sleep aid, source says

CNN —  

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.

Symptoms of PTSD can include, but are not limited to, feelings of anxiety, insomnia and nightmares.

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.

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

Gunman advocated ‘fighting back’

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, 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.

Gavin Long: Who is Baton Rouge cop killer?

Edmonson told CNN on Wednesday that Long was seen “riding around” the area in the days before the attack. The shooter stayed at several locations, according to Edmonson. State police have interviewed people who interacted with Long.

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.”

In another video, Long is in Baton Rouge driving around with a man he apparently recently met and offering people copies of a self-published self-help book. Long talks almost the entire time, lecturing one young man about life, telling him to develop multiple job skills and not strictly depend on income from his rapping. Long also tells him not to trust people of other races.

He says if he had been there when Sterling was killed he would have done something.

Long 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.

Carl Woodley, Long’s stepfather, said he was in “total shock” about the Baton Rouge shootings. He said he was sorry about what happened to the officers and about losing his stepson.

Woodley said Long was about 7 when they met and he remembered him as a good, quiet and intelligent boy.

“I never had … problems with him,” he said. “He wasn’t my biological son, but he was a son to me. … We were real close.”

Long never talked to him about anger toward the police or the way they treated blacks, said Woodley, who added he never saw his stepson with a weapon.

Baton Rouge, Dallas shooters were military veterans

During his five years in the Marine Corps, Long served in Iraq from June 2008 to January 2009, and also spent some time in California and Japan.

He received a handful of awards, including the Marine Corps Good Conduct Medal.

Of the more than 2.5 million U.S. military veterans who served in Iraq and Afghanistan, 11% to 20% have PTSD in a given year, the U.S. Department of Veterans Affairs says. That’s a higher rate than the general U.S. population, 7% to 8% of which will have PTSD at some point in their lives, the department says.

A research report on the department’s website says that “although PTSD is associated with a risk of violence, most people with PTSD have never engaged in violence.”

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 delivered by a police robot on the night of the Dallas attack after failed negotiations, police said.

In an interview this month with The Blaze, Johnson’s parents and stepmother said he changed after military service, which included deployment to Afghanistan from late 2013 to mid-2014. Before joining the military, he’d wanted to become a police officer, said his mother, Delphine Johnson.

“The military was not what Micah thought it would be,” she said. “He was very disappointed, very disappointed. But it may be that the ideal that he thought of our government, what he thought the military represented, it just didn’t live up to his expectations.”

CNN’s Debra Goldschmidt and Brian Todd contributed to this report.