The gunman's "movements, his direction, his attention was on police officers," state police Col. Mike Edmonson said. He would not elaborate but said the shooter was definitely "seeking out" police.
Three other officers were wounded Sunday, one critically. The gunman was identified as Gavin Long of Kansas City, Missouri, who was black. He turned 29 on the day of the ambush and was killed in a gunbattle with police.
In online posts, a man using an alias of Long's said protests alone do not work, and that people must fight back after the deaths of black men at the hands of police.
Documents show that Long sought to change his name last year to Cosmo Setepenra. A website using that name links to online books about nutrition, self-awareness and empowerment. The man describes himself as a "freedom strategist, mental game coach, nutritionist, author and spiritual advisor."
In a video posted July 10, the person making the post says he's speaking from Dallas after five police officers were fatally shot there during a protest of the deaths of black men in encounters with law enforcement. The man also discusses protests in Baton Rouge and what he perceived as oppression.
PHOTOS: Baton Rouge police shooting
He says: "You've got to fight back. That's the only way a bully knows to quit." In an earlier video, the man says that if anything ever happens to him, he doesn't want to be linked to any groups and mentioned once belonging to Nation of Islam.
In documents seeking the name change, Long also referred to himself as a member of a black separatist group known as the Washitaw Nation.
The attack unfolded less than two weeks after Baton Rouge police fatally shot a black man in a confrontation that reverberated nationwide.
Edmonson also confirmed that investigators have interviewed people with whom the shooter had contact in Baton Rouge. He would not say how many or give details and stressed that the interviews do not mean that those people were involved in the shooting. He urged anyone else with information about Long to come forward.
The shooting less than a mile from police headquarters added to the tensions across the country between the black community and police. It was the fourth high-profile deadly encounter in the United States involving police over the past two weeks. In all, the violence has cost the lives of eight officers, including those in Baton Rouge, and two civilians and sparked a national debate over race and policing.
Long served in the Marines from 2005 to 2010, reaching the rank of sergeant. He deployed to Iraq from June 2008 to January 2009, according to military records.
While in the military, Long was awarded several medals, including one for good conduct, and received an honorable discharge. His occupational expertise was listed as "data network specialist."
Although he was believed to be the only person who fired at officers, authorities were investigating whether he had any help.
"We are not ready to say he acted alone," state police spokesman Major Doug Cain said Sunday.
On Monday morning, businesses around the shooting scene began to reopen. Customers bought coffee and breakfast sandwiches at a B-Quik convenience store. Next door, workers prepared for the day at a car wash where the gunman had been cornered.
Buildings at the scene were scarred with at least eight apparent bullet marks. Investigators examined a hole in a window at a fitness-supply business, and wood covered another window that was shot out.
Long attended classes at the University of Alabama for one semester in the spring of 2012. A school spokesman said university police had no interactions with him.
He was also briefly enrolled at Clark Atlanta University during the 2012-13 academic year, the school said.
Long sought to change his name last year in a document filed in May 2015 with the recorder of deeds in Jackson County, Missouri. He also said he was a member of the Washitaw de Dugdahmoundyah, or the Washitaw Nation.
The group describes itself as a sovereign nation composed of blacks descended from ancestors who settled in North American before Columbus, according to the Southern Poverty Law Center.
The name-change document ends: "Standing firm on the Ancient Principles of, LOVE, TRUTH, PEACE, FREEDOM AND JUSTICE."
The shooting began at a gas station and convenience store where, according to radio traffic, police answered a report of a man with an assault rifle and were met by gunfire. For several long minutes, they did not know where it was coming from.
The radio exchanges were made public Sunday by the website Broadcastify. The recording lasts about 17 minutes and includes urgent calls for an armored personnel carrier called a BearCat.
The store was an ideal target for someone wanting to catch police off-guard because uniformed officers constantly go there during morning hours, said Frank Cooper, who works at a garage just yards from the shooting scene.
"It's a convenient place for them to stop and get their coffee and buns," Cooper said.
Brady Vancel, who installs floors, was arriving for work at a group home when he heard gunfire. Despite the danger, he began walking toward the noise and saw a man in black with an assault rifle running across a grassy field directly toward him.
"He saw me and went the other way," said Vancel. "I was in shock, and he was acting impulsively. I'm just glad he didn't shoot me."
Agents from the federal Bureau of Alcohol, Tobacco, Firearms and Explosives were trying to determine where Long obtained the guns.
Of the officers who survived the shooting, one was released from the hospital Monday. Two others remained hospitalized, one in critical condition.
Two of the slain officers were from the Baton Rouge Police Department: 32-year-old Montrell Jackson, who had been on the force for a decade, and 41-year-old Matthew Gerald, who had been there for less than a year.
The third fatality was Brad Garafola, 45 and a 24-year veteran of the East Baton Rouge Sheriff's Office.
All three of the slain officers lived in Denham Springs, a racially mixed city outside Louisiana's capital.
Autopsies on the officers were planned for Monday, and the coroner expected to release preliminary findings later in the day. An autopsy on the suspect was scheduled for Tuesday.
Police-community relations in Baton Rouge have been especially tense since the death of 37-year-old Alton Sterling, a black man killed by white Baton Rouge officers after a scuffle at a convenience store. The killing was captured on cellphone video.
It was followed a day later by the shooting death of another black man in Minnesota, whose girlfriend livestreamed the aftermath of his death on Facebook. The next day, a black gunman in Dallas opened fire on police.