BATON ROUGE, La. (AP) -- Three Baton Rouge law enforcement officers were killed and three others wounded Sunday, less than two weeks after a black man was shot and killed by police here in a confrontation that sparked nightly protests across the city that reverberated nationwide.
Police said the suspect was shot and killed at the scene. Authorities initially believed that two other assailants might be at large, but hours later said the dead gunman was the only person who fired at the officers.
However, a state police spokesman said investigators were unsure whether he had some kind of help from others.
"We are not ready to say he acted alone," Major Doug Cain said. Two people were detained in the nearby town of Addis. Cain called them "persons of interests."
The shooting - which took place just before 9 a.m., less than a mile from police headquarters - came amid escalating tensions across the country between the black community and police. The races of the suspect and the officers were not immediately known.
It was the fourth high-profile deadly encounter in the United States involving police over the past two weeks. The violence has left 12 people dead, including eight police officers, and sparked a national conversation over race and policing.
President Barack Obama said the slayings were attacks "on the rule of law and on civilized society, and they have to stop." He said there was no justification for violence against law enforcement and that the attacks are the work of cowards who speak for no one.
The exact circumstances of the attack were unclear, and authorities did not discuss the gunman's motive or any relationship to the wider police conflicts.
The shooting began at a gas station on Airline Highway. The suspect's body was next door, outside a fitness center. Police said they were using a specialized robot to check for explosives near the body.
A law enforcement official familiar with the investigation said the shooter was identified as Gavin Long but had no details. The official spoke on condition of anonymity because the official was not authorized to discuss an ongoing investigation.
Gov. John Bel Edwards rushed to the hospital where the shot officers were taken.
"There simply is no place for more violence," Edwards said. "That doesn't help anyone. It doesn't further the conversation. It doesn't address any injustice perceived or real. It is just an injustice in and of itself."
A witness told television station WAFB that he saw a masked man in black shorts and shirt running from the scene where the three officers were killed.
Brady Vancel said the man looked like a pedestrian running with a rifle in his hand, rather than someone trained to move with a rifle.
Vancel said he had gone to work on a flooring job near the gas station when he heard semi-automatic gunfire and perhaps a handgun. He saw a man in a red shirt lying in an empty parking lot and "another gunman running away as more shots were being fired back and forth from several guns."
On Sunday afternoon, more than a dozen police cars with lights flashing were massed near a commercial area of car dealerships and chain restaurants on the highway. Police armed with long guns stopped at least two vehicles driving away from the scene and checked their trunks.
That area was about a quarter of a mile from a gas station, where almost nightly protests had been taking place.
Five officers were rushed to Our Lady of the Lake Regional Medical Center, hospital spokeswoman Ashley Mendoza said.
Of the two who survived the shooting, one was in critical condition and the other was in fair condition. Multiple police vehicles were stationed at the hospital, and a police officer with a long gun was blocking the parking lot at the emergency room.
One officer was sent to Baton Rouge General Medical Center and was being treated for non-life-threatening injuries, spokeswoman Meghan Parrish said.
Officers and deputies from the Baton Rouge Police Department and East Baton Rouge Sheriff's Office were involved, Hicks said.
Each of the officers was married and had a family, East Baton Rouge Parish Sheriff Sid Gautreaux said.
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 officers July 5 after a scuffle at a convenience store. The killing was captured on widely circulated 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 at a protest about the police shootings, killing five officers and heightening tensions even further.
Thousands of people have protested Sterling's death, and Baton Rouge police arrested more than 200 demonstrators.
Sterling's nephew condemned the killing of the three officers.
Terrance Carter spoke Sunday to The Associated Press by telephone, saying the family just wants peace.
"My uncle wouldn't want this," Carter said. "He wasn't this type of man.
Michelle Rogers said Sunday the pastor at her church had led prayers Sunday for Sterling's family and police officers, asking members of the congregation to stand up if they knew an officer.
Rogers said an officer in the congregation hastily left the church near the end of the service, and a pastor announced that "something had happened."
"But he didn't say what. Then we started getting texts about officers down," she said.
Rogers and her husband drove near the scene, but were blocked at an intersection closed down by police.
"I can't explain what brought us here," she said. "We just said a prayer in the car for the families."
© 2016 The Associated Press. All rights reserved.