Three police officers were killed and three wounded in a shootout Sunday in the Louisiana capital Baton Rouge with a gunman who died at the scene, authorities said.
A man carrying a rifle exchanged fire with police for several minutes, Louisiana State Police Superintendent Colonel Mike Edmonson said.
"We belive that the person that shot and killed our officers is the person that is dead at the scene," he said.
Authorities had earlier said they were searching for two more suspects in the shooting, which left three officers wounded including one in critical condition after surgery.
Baton Rouge newspaper The Advocate reported that the gunman was 29-year-old Gavin Eugene Long, citing state and federal law enforcement sources.
The shooting came 10 days after a gunman opened fire on police at a rally in Dallas against police violence, killing five officers, wounding six and one civilian. The attacker was later slain by police.
US President Barack Obama condemned "in the strongest sense of the word" the attack in Baton Rouge.
"For the second time in two weeks, police officers who put their lives on the line for ours every day were doing their job when they were killed in a cowardly and reprehensible assault," he said.
"These are attacks on public servants, on the rule of law, and on civilized society, and they have to stop."
The July 7 Dallas shooting came two days after the killing of 37-year-old Alton Sterling, an unarmed African-American who was tackled and shot by police outside a convenience store in Baton Rouge.
On July 6, Philando Castile, 32, died after being shot four times by a police officer during a traffic stop near Minneapolis, Minnesota.
The incidents inflamed tensions among minority communities over police killings in the last two years.
The Advocate reported that Long, an African-American former US Marine, had an active online media presence calling himself Cosmo Setepenra. He had been outspoken about the Sterling killing, and claimed to be in Dallas during the attack on police there.
Obama said he had offered full federal support to local authorities in the case.
"We may not yet know the motives for this attack, but I want to be clear: There is no justification for violence against law enforcement - none," he said.
"These attacks are the work of cowards who speak for no one. They right no wrongs. They advance no causes."
Just ahead of the Republican Party's nominating convention this week, presumptive nominee Donald Trump tweeted: "We are TRYING to fight [the Islamic State terrorist group], and now our own people are killing our police. Our country is divided and out of control. The world is watching."
His general election rival, Hillary Clinton, called the shooting an unjustifiable "assault on all of us."
"We must not turn our backs on each other. We must not be indifferent to each other," she said. "We must all stand together to reject violence and strengthen our communities."
Obama similarly called for national unity: "We don't need inflammatory rhetoric. We don't need careless accusations thrown around to score political points or to advance an agenda. We need to temper our words and open our hearts - all of us."