The man suspected of killing three police officers in Baton Rouge, Louisiana, on Sunday morning was a member of the group Nation of Islam and left behind a vast digital footprint, including videos on a YouTube channel in which he spoke about racial tensions in the US.

The suspect, whom law-enforcement officials have identified as Gavin Eugene Long, was shot and killed after exchanging gunfire with officers who were responding to a 911 call about a man who was wearing all black and carrying a long gun.

Long was a black male from Kansas City, Missouri, who turned 29 on Sunday. He was a Marine veteran who served from 2005 to 2010, including one deployment in Iraq. He was a data specialist, according to CNN. He was divorced in 2011.

On social media, Long went by the name "Cosmo," multiple media outlets have confirmed with law-enforcement officials. He described himself on his website as "an avid student of nutrition, health, fitness, personal transformation and spiritual mastery since the age of 16." He wrote that a "spiritual journey took him across Rwanda, Ethiopia, Uganda, Kenya, Tanzania, Egypt, Ghana, and Burkina Faso," and he appeared to identify strongly with his Ethiopian heritage.

In his many YouTube videos and Twitter posts, however, Long revealed his frustration with the killing of black Americans by the police, writing on Twitter that he feared his "people" would soon become "extinct" if action weren't taken.

"Violence is not THE answer (its a answer), but at what point do you stand up so that your people dont become the Native Americans...EXTINCT?" Long posted on July 13.

In a video posted on July 10, three days after the Dallas police shootings that left five officers dead and seven wounded, Long said: "Every time an African fights back, he's wrong. But every time a European tries to fight back, he's right. Why is that? You've got to fight back, that's the only way a bully knows to quit."

"100% have been successful through fighting back, through bloodshed," Long continued in the video, titled "Convos With Cosmo on Protesting, Oppression, and how to deal with Bullies."

"Zero have been successful just over simply protesting," he said.

Long apparently posted the below video from Dallas. He said he decided to come to Dallas before the police shootings occurred, however.

—Convos With Cosmo (@ConvosWithCosmo) July 10, 2016

He also expressed solidarity with Micah Johnson, the shooter in the Dallas attack, calling him "one of us" on Twitter.

—Convos With Cosmo (@ConvosWithCosmo) July 8, 2016

"You cant talk (or protest) the devil into changing his ways, this has never been done and never will # 1.Exact Justice (Blood) or 2.Revenue," he posted on July 10.

He posted his final message just hours before Sunday's shooting.

—Convos With Cosmo (@ConvosWithCosmo) July 17, 2016