Doug Stanglin, and Kevin Johnson

USA TODAY

The gunman who allegedly shot and killed three Baton Rouge police officers on Sunday was identified as Gavin Long, 29, a Kansas City resident, according to two federal law enforcement sources. A Pentagon official confirmed that Long is a Marine veteran who served in Iraq in 2008.

After opening fire on police, Long was killed at the scene. The attack occurred on his 29th birthday.

Long, an African-American, is from the Kansas City area, but does not appear to have family links to Baton Rouge, according to a federal law enforcement source who is not authorized to speak publicly. Investigators are looking at Long's possible links to black separatists groups, the source said.

Police believe that Long may have been in a rental car that had been stolen five or six days ago in a Midwestern state, according to the source.

Pentagon officials said Long was a data network specialist in the Marines, where he held the rank of sergeant. He served an 8-month tour of Iraq, beginning in the summer of 2008.

Public records indicate that Long has lived in two Missouri cities — Kansas City and Grandview — as well as Tuscaloosa, Ala., where he apparently was a student at the University of Alabama.

The University of Alabama website listed a Gavin Eugene Long of Kansas City on Dean’s List in 2012. Long graduated in 2005 from Grandview High School, according to The Kansas City Star.

Several media outlets said Long appears on social media under the pseudonym Cosmo Setepenra, who describes himself online as a holistic teacher and author. He also has what appears to be a self-published book available on Amazon.

On the Cosmo website, he describes himself as self-educated on fitness, nutrition and diet. He refers to he military service and says he was one of the most physically fit and disciplined Marines.

He also says he conducts sports nutrition workshops locally, nationally, and internationally, although his YouTube videos, as of Sunday, appeared to have been viewed by only a handful of people.

The Kansas City Starreports that the domain for these accounts and websites are registered under the name Gavin Long and list a Kansas City address.

In a recent video on YouTube, under the account "Convos with Cosmo," Long, purportedly speaking as Cosmo, discusses oppression, protests and Baton Rouge.

Speaking directly into the camera, Cosmo says protests are a waste of time, that the only thing that oppressors understand is "blood and money."

He says the only fighting oppression and bullies has only been successful historical "through bloodshed."

"Zero have been successful by simply protesting. It has never worked," he says. "It never will. you have got to fight back, that is the only way the bullies know to quit."

He says he knows his rights. "That's what separates me, that is why they are afraid of me ... that is the key. if what I got in me, the courage, the tenacity, the bravery, if that spreads, its will be over. That's what the revolution is."

Law enforcement officers converged Sunday on a home in Kansas City listed for Long. The small turquoise frame house with a front porch is in a lower income neighborhood in the southern part of the city.

A journalist for the Kansas City Star who went to the address earlier on Sunday was met by a man with a long gun who declined to comment, the newspaper says.

Missouri court records show Long filed for divorce from his wife on Valentine's Day, 2011 in Kansas City court. The couple apparently had no children. The divorce was finalized on May 24, 2011.

Contributing: Mark Nichols