Long praised Dallas shooter Micah Johnson and said bloodshed was the only solution.

Baton Rouge: What we know so far about the shootings and gunmanReuters

The Baton Rouge gunman who shot six police officers, killing three of them, has been identified by authorities as Gavin Eugene Long of Kansas City, Missouri. Long had an active social media presence and used his podcast, "Convos With Cosmo," to discussed topics ranging from nutrition to the government.

Long was a US Marine Corps veteran from August 2005 to August 2010 . He served in Iraq between 2008 and 2009. Yvonne Carlock, the deputy public affairs officer for the United States Marines, told the New York Times that Long held the rank of sergeant and earned several awards including: Marine Corps Good Conduct Medal, Iraq Campaign Medal, Global War on Terrorism Service Medal, and others.

He was given an honourable discharge in 2010.

The 29-year-old, who died in a shootout with police, visited Dallas, Texas last week and praised shooter Micah Johnson for killing five officers. On 13 July, Long took to Twitter to proclaim that bloodshed was the only way to win over oppression. "Violence is not THE answer (its a answer), but at what point do you stand up so that your people don't become the Native Americans ... EXTINCT?" he tweeted.

He also said protests would help. "One hundred percent of revolutions, of victims fighting their oppressors, from victims fighting their bullies, 100% have been successful through fighting back through bloodshed," he said in one of his videos. "Zero have been successful through simply protesting. It has never been successful and it never will."

Gavin Eugene Long, seen here in on of his 'Convos with Cosmo' videos, was identified as the gunman of the Baton Rouge shooting, which left three officers dead.YouTube

In a separate video, Long asked that he not be affiliated with any specific group or movement, BuzzFeed News reported. Long said he was once a Nation of Islam member but was no longer affiliated. He also said he was not affiliated with the Islamic State (Isis). "I made my own decisions. I'm the one who gotta listen to the judgment. That's it and my heart is pure," he said.

Hours before the shooting, Long hinted that he was not afraid of death in a final tweet. "Just bc you wake up every morning doesn't mean that you're living. And just bc you shed your physical body doesn't mean that you're dead," he wrote.

Long's last known address was in Kansas City, Missouri. According to CBS News, Long rented a white Chevy vehicle in Kansas City on 12 July and drove to Baton Rouge.