Police officers attend a church service after a fatal shooting of Baton Rouge policemen, at Saint John the Baptist Church in Zachary, Louisiana, July 17, 2016. | (Photo: Reuters/Jeffrey Dubinsky)

A police officer is embraced after a vigil for the fatal attack on Baton Rouge policemen, at Saint John the Baptist Church in Zachary, Louisiana, July 17, 2016 | (Photo: Reuters/Jeffrey Dubinsky)

A still image from a Youtube video posted on an account linked to an individual named Gavin Long, suspected of killing three police officers in Baton Rouge, Louisiana, U.S. July 17, 2016. The video was posted on July 10, 2016 to the account of Convos with Cosmo, which has been linked to Long. | (Photo: Gavin Long/Youtube via Reuters)

General view during a moment of silence for those affected by the tragic events in Baton Rouge, LA earlier today before a game between the New York Yankees and the Boston Red Sox at Yankee Stadium. | (Photo: Reuters/USA TODAY Sports/Brad Penner)

Bob Ossler, a chaplain for the Police and Fire Department of Millville, New Jersey, holds a cross at a makeshift memorial for three police officers who were shot and killed in Baton Rouge, Louisiana, July 18, 2016. | (Photo: Reuters/Jonathan Bachman)

BATON ROUGE, La. — The black U.S. Marine Corps veteran who shot dead three police officers in Louisiana's capital planned his attack for days and then assassinated the men, police said on Monday, as the United States reeled from the latest deadly shooting involving police and African-Americans.

One of three officers wounded in Sunday's shootings was hit in the head and stomach and was fighting for his life, police said at a news conference in Baton Rouge, which has been the scene of repeated protests against police violence after the July 5 fatal shooting by officers of Alton Sterling, a black man, outside a convenience store.

"There is no doubt whatsoever that these officers were intentionally targeted and assassinated," Louisiana State Police Superintendent Colonel Mike Edmonson said at the news conference. "It was a calculated act against those who work to protect this community every single day."

Edmonson said "the most compelling piece of evidence is the video" of the shooting. Three guns were recovered from the scene and much was left to be learned about the attack, including the gunman's social media footprint, Edmonson told reporters. He said the gunman "had been in our community for several days."

The gunman has been identified as Gavin Long, a 29-year-old from Kansas City, Missouri, who served in the Marines for five years, including a 2008 deployment in the Iraq war. Long, dressed in black and armed with a rifle, was shot dead on Sunday morning in a gunfight with police.

Racial tension in the United States has been especially high since a black former U.S. Army Reserve soldier fatally shot five Dallas police officers who were patrolling a protest over the police shootings of Sterling and another black man in Minnesota.

An East Baton Rouge Sheriff vehicle is seen with bullet holes in its windows near the scene where police officers were shot in Baton Rouge, Louisiana, U.S. July 17, 2016. | (Photo: Reuters/Jonathan Bachman)

The suspect said he wanted to change his name from Gavin Eugene Long to Cosmo Ausar Setepenra in May 2015, according to Jackson County, Missouri, public records. But court officials said he never completed the process of legally changing his name.

A website, social media accounts and YouTube videos that appeared tied to Long included complaints about police treatment of black people and praise for killings of the Dallas policemen.

Louisiana Governor John Bel Edwards told Monday's news conference that Long "came to do harm," and he called the shooting "pure, unadulterated evil."

Police said a member of the SWAT team that responded to the scene killed Long with a shot from 100 yards away. East Baton Rouge Parish Sheriff Sid Gautreaux said he had "no doubt" that Long would have killed additional officers if not for that shot.

Long also affiliated himself with the Washitaw Nation, an African-American offshoot of the Sovereign Citizen Movement, a group whose members view the federal government as illegitimate.

Two other officers were treated for their wounds in hospital and released.

Memorial at Shooting Scene

At the B Quick gas station where the shootings occurred, people left flowers and balloons in memory of the slain officers.

"I just want us to have peace and drive down the road and not feel like we have to duck our heads and look around and see if someone's going to be on top of a roof," said Pam Collins, a resident of the Baton Rouge suburb of Prairieville who brought three shiny balloons to honour the officers.

Items left on a makeshift memorial are seen at Our Lady of the Lake Regional Medical Center in Baton Rouge, Louisiana, U.S., July 18, 2016. | (Photo: Reuters/Jonathan Bachman)

Presumptive Democratic presidential nominee Hillary Clinton, in a speech to the NAACP civil rights group in Cincinnati, said she would bring the "full weight of the law to bear" against cop killers but added that here is "another hard truth at the heart of this complex matter: Many African-Americans fear the police."

But she added that the police shootings of Sterling in Baton Rouge and Philando Castile in Minnesota "drove home how urgently we need to make reforms to policing and criminal justice (and) how we cannot rest until we root out implicit bias and stop the killings of African-Americans."

Her Republican rival for the presidency, Donald Trump, tweeted that "our country is a divided crime scene" and called for stronger leadership on law and order issues.

U.S. Attorney General Loretta Lynch said agents from the Federal Bureau of Investigation, the Bureau of Alcohol, Tobacco, Firearms and Explosives and the U.S. Marshals Service were in Baton Rouge.

"At the Department of Justice, we are determined to do everything we can to bridge divides, to heal rifts, to restore trust, and to ensure that every American feels respected, supported, and safe," Lynch said in remarks prepared for a conference of black law enforcement officers in Washington.

Louisiana's capital has a long history of distrust between black residents and law enforcement and it has been inflamed by Sterling's death. For many in Baton Rouge, the police have been viewed as overly aggressive and unrepresentative of a city where more than half the 230,000 residents are black.

A local state legislator, Republican Barry Ivey, said in aftermath of Sunday's shootings political leaders should "lay the rhetoric aside" and focus on peaceful solutions.

The recent U.S. violence has heightened security concerns, notably for the Republican convention beginning in Cleveland where Donald Trump is positioned to get his party's nomination for the Nov. 8 presidential election, and the upcoming Democratic convention in Philadelphia where Clinton is due to get her party's nomination.

(Additional reporting by Sam Karlin in Baton Rouge, David Alexander and Eric Walsh in Washington, Laila Kearney in New York; Writing by Will Dunham and Grant McCool; Editing by Bill Trott)