The day after five police officers were fatally shot during a protest in Dallas, 29-year-old Gavin Long took to YouTube to express a controversial view on the incident.

“I’m not gonna harp on that, you know, with a brother killing the police. You get what I’m saying?” Long said, according to a video posted online. “That’s, it’s justice.”

Long — who law enforcement officials believe fatally shot three officers in Baton Rouge and wounded three others — appears to have been eager for black people to take a strong physical stance against mistreatment by authorities, according to online footage and other materials. In one video, referring to Native Americans, he said, “When they were extincted by the same people that run this country, my question to you, just something you can think about: At what point should they have stood up?”

In another, he praised the Deacons for Defense and Justice — a group of African Americans who formed an armed self-defense group during the civil rights movement of the 1960s — as men who “when they kids was also getting killed by cops and other white supremacy members, they stood up and stood firm.” Long was black.

“It’s a time for peace, but it’s a time for war, and most of the times when you want peace, you got to go to war,” Long said, jazz playing in the background as he spoke. “You see what I’m saying?”

Long, who lived in Kansas City, Mo., also appeared to have affiliated himself with a particular brand of what is known as the sovereign citizen movement, which advocates black sovereignty, according to a document obtained by The Washington Post. The Kansas City Star first reported on the document — filed with the Jackson County, Mo., recorder of deeds — which shows Long tried to change his name to Cosmo Ausar Seteprenra and declared his allegiance to the Washitaw Nation.

Sovereign citizen adherents say they aren’t U.S. citizens but instead “nonresident aliens” not subject to taxes, government regulations or any local, state and federal laws. They deny the legitimacy of the 14th Amendment, which in the wake of the Civil War guaranteed citizenship and civil rights to everyone born in the United States. The loose movement is generally associated with white supremacy. Indeed, Allen “Lance” Scarsella, the man charged with shooting five people at a Black Lives Matter demonstration in Minneapolis last November, was linked to a sovereign citizen group, as The Post’s Sarah Kaplan reported. 

But the Washitaw Nation branch or splinter of the group has its roots in “advocating black sovereignty” from white America, according to the Southern Poverty Law Center.

Baton Rouge Police Chief Carl Dabadie said officers "did exactly how they were trained" after a gunman shot three officers dead and wounded three more. (Reuters)

Many details remain unclear about why — and even how — Long killed two Baton Rouge police officers and one East Baton Rouge sheriff’s deputy before law enforcement officers fatally shot him. Police have said that they were contacted about a man “carrying a weapon, carrying a rifle” about 8:40 a.m. Sunday, and after officers in the area spotted the man, a shootout occurred. A police spokesman said Monday that Long appeared to have been targeting the officers and that the incident was an “ambush.”

The videos online suggest Long was willing to endorse violent methods to take on those in power. In one clip — purportedly filmed in Dallas after the shooting of police officers there — he said merely holding demonstrations had “never worked, and it never will” and praised Nat Turner, who led a slave rebellion, and Malcolm X.

“If you all want to keep protesting, do that, but for the serious ones, the real ones, the alpha ones, we know what it’s gonna take,” Long said. “It’s only fighting back or money. That’s all they care about. Revenue and blood.”

Near Long’s home in Kansas City, which remained cordoned off with yellow crime-scene tape Sunday night, a woman who identified herself as Long’s aunt and gave her first name as Donna acknowledged that Long “killed innocent people” but said he was “a very, very good person, a very very good student.”

“We’re hurting, too,” she said.

A cousin of Long’s said that, at least to him, Long had never expressed black nationalist views or even seemed particularly upset about police killings of black men. Tensions have been high since Alton Sterling was shot and killed as two Baton Rouge police officers tried to take him into custody earlier this month. His death, partly captured on video, sparked intense protests in the city and nationwide, and the Justice Department is investigating.

Long’s cousin, who spoke on the condition of anonymity so as not to affect his employment, said family members believed that Long had gone to Louisiana to celebrate his birthday on Sunday and to promote a book he had written recently. He said Long — who had served in the military and attended the University of Alabama at least briefly — was “very smart” and “loved doing stuff for people.”

“Right now, I’m at a loss for words,” said the cousin, who confirmed that Long was the person speaking in the online videos. “I don’t know what was going on with him.”

Records released by the military Sunday show that Long served five years in the Marine Corps as a data network specialist, from August 2005 to August 2010. He left active duty as a sergeant, according to the records.

The records show that Long deployed once to Iraq from June 2008 to January 2009 and did not experience direct ground combat. He was assigned to units in San Diego and Okinawa, Japan, during his military career. At least one of the officers slain, Matthew Gerald, had military experience, a friend said.

Central Texas College said that Gavin Eugene Long attended the school at its Marine Corps Air Station Miramar site in San Diego and via an online education program from fall 2007 to summer 2011. He attained an associate of arts degree in general studies, the college said.

Chris Bryant, a University of Alabama spokesman, said Gavin Eugene Long was a student at the school for one semester in spring 2012, and university police had no interactions with him during his time there.

The Anti-Defamation League, which tracks extremists across the country, said it could not immediately find any direct ties connecting Long to any extremist groups. Long asked in one video not to be affiliated with any particular group, even if evidence emerged of his interest in them.

“I’m affiliated with the spirit of justice. Nothing else. Nothing more, nothing less,” Long said.

Long posted a video online that seems to show him distributing his book to people on the street, and his cousin said he believed that is what Long may have been doing in Baton Rouge. One of his books, “The Cosmo Way: A W(H)olistic Guide for the Total Transformation of Melanated People,” is styled almost as a self-help guide.

Under the pen name Cosmo Setepenra, the same name filed with the recorder of deeds in Missouri, Long claimed in the book that he had a “spiritual revelation” while in college and soon sold his cars and gave away his “material possessions,” packing just two suitcases for a trip to Africa — his “ancestral homeland.” He wrote that he traveled across the continent learning from its “native spiritual practitioners and elder holistic healers” and was concerned in particular that people with darker skin lead healthy, holistic lifestyles.

“Not only have we not been taught how to treat our bodies and spirits in order to live a healthy and holistic lifestyle, we have also lost touch with the ancient teachings of our spiritual elders that would help us to live a healthy holistic life in harmony with nature,” he wrote.

Long wrote or posted online frequently under the handle “Cosmo” on an eclectic mix of topics. He described himself online as a “nutritionist, life coach, dietitian, personal trainer, author and spiritual advisor.” Records show he was married in 2009 and divorced in 2011, and his online videos and writings seem to suggest a reverence for black women. His book contains a special thank you to “the all-powerful, most beautiful, one and only Black woman.” Efforts to reach his ex-wife were unsuccessful.

Jenny Reese, a 34-year-old reiki master who practices an alternative therapy that promotes hands-on healing, said she met Long — whom she knew simply as “Cosmo” — in February when he stopped by a Virginia Beach reiki center. She said that Long gave her a copy of one his books, “The Laws of Cosmos,” and then left.

“He said he was on his book tour,” she said. “I was working at the front desk, and we chatted for about 15 minutes. He was just telling me that he was into energy healing.”

Reese said she later interacted with Long on his Twitter account, “Convos with Cosmos.” She said he seemed to be outgoing and chatty. On Monday morning, a Washington Post reporter told her that Cosmos was the Baton Rouge shooter.

“I’m very surprised because he seemed to be such a positive person,” she said. “He was trying to get out there and meet people.”

Although a review of Long’s online postings Sunday night did not immediately reveal a motive, his Twitter page offered a hint that he may not have feared death.

“Just bc you wake up every morning doesn’t mean that you’re living,” he posted not long before the shootings. “And just bc you shed your physical body doesn’t mean that you’re dead.”

Amy Brittain in Baton Rouge; Diana Reese in Kansas City, Mo.; and Mark Berman, Adam Goldman, Dan Lamothe, Abby Ohlheiser and Julie Tate in Washington contributed to this report.