The shooter who gunned down and killed at least three Baton Rouge police officers has been identified as Gavin Long, The Associated Press reported.

Long is a former Marine and the person behind the online avatar Cosmo Setepenra, a "spiritual advisor," life coach and author, according to The Advocate.

The attack which left three officers dead and three others wounded occurred on Long's birthday, July 17, according to the Times-Picayune. The shooting took place just before 9 a.m., less than a mile from police headquarters.

A spokesman for the Louisiana State Police says they believe Long was the only shooter. However, officials are unsure whether he had accomplices.

>>Read more about the attack on Baton Rouge police

"We are not ready to say he acted alone," Maj. Doug Cain said.

Cain said two other "persons of interest" were being detained in Addis, a town near Baton Rouge. They were later released.

Long, 29, was shot and killed at the scene. Authorities initially believed that two other assailants might be at large, but hours later said that no other active shooters were in the city.

>> Read more trending stories

Law enforcement officers converged on a house in Kansas City, Missouri, that is listed for a man named Gavin Long. Authorities were trying to ensure that there was no one in the house.

Long briefly attended the University of Alabama for one semester during 2012. University police had no interaction with Long during that time. He got his associate's degree at Central Texas College and spent a year at Clark Atlanta University, according to The Advocate.

Long enlisted in 2005 and was deployed to Iraq three years later, according to The Advocate. He left the military in August 2010 after he reached the rank of sergeant.

He posted a series of YouTube videos called Convos with Cosmos. In a recent video titled "Protesting oppression and how to deal with bullies," Long spoke about the recent protests.

“If y’all wanna keep protesting, do that, but for the serious ones, the real ones, the alpha ones, we know what it’s going to take. It’s only fighting back of money, that’s all they care about,” Long said. “Revenue and blood. Revenue and blood. Revenue and blood. Revenue and blood. Nothing else.”