(BATON ROUGE, La.) -- A gunman in Baton Rouge had already shot at law enforcement officers Sunday morning when a deputy at the scene who had hidden behind a dumpster left his cover with gun drawn to help a fallen officer, police said Monday.
The deputy, Brad Garafola, 45, of the East Baton Rouge Sheriff’s Department, was then shot and killed by the attacker.
"We're trained to take care of our own," Louisiana State Police Superintendent Col. Mike Edmonson said. Garafola went "back to help that police officer."
"My deputy went down fighting," East Baton Rouge Sheriff Sid Gautreaux said. "He returned fire to the very end."
"He died as a hero, protecting and serving," Gautreaux said. "So did the other officers. I think it's important we remember as we move forward, they are gone but they're not forgotten."
Garafola leaves behind a wife and four children, Gautreaux said.
Besides Garafola, two others officers died in the attack: Matthew Gerald, 41, also of the East Baton Rouge Sheriff's Department, and Montrell Jackson, 32, of the Baton Rouge Police Department.
Gerald, "a devoted husband and father of two," served in the Marine Corps and Army before joining the police department, Baton Rouge Police Chief Carl Dabadie Jr. said.
Gerald "served his country proudly and with honor," Dabadie said. "He spent his whole life serving this country and our city, and he is a hero for everything that he has done."
The gunman, former U.S. Marine Gavin Long, who was killed by a Baton Rouge police S.W.A.T. team, ignored civilians in the area and "intentionally targeted and assassinated" cops, Edmonson said, calling it a "calculated act."
Dabadie said a S.W.A.T. team -- who fired at the gunman from 100 yards away -- prevented further bloodshed.
"He was not going to stop here," Dabadie said of the gunman. "After he was finished here I have no doubt he was heading to our headquarters, and he was going to take more lives. Our 'militarized tactics,' as they're being called, saved lives here. That shot that our S.W.A.T. team made was a hell of a shot."
Edmonson said after the gunman was killed, "Someone was still actively on his Facebook page that had been created to say he was still alive."
"One of the most and more challenging aspects of this investigation is examining the social media footprint of the suspect," Edmonson said.
The shootings began when Long first "noticed a Baton Rouge police officer vacuuming his car" at a car wash frequented by officers, Edmonson said. The officer left the scene, and "that's when the call comes in to say there was an individual ... with a rifle."
Police went to the area where Long was, Edmonson said at a news conference with a map of the shooting site in the background. “When [Long] came back around, that's two Baton Rouge police officers were standing right here. He shot both of them.”
Garafola, after taking cover behind a dumpster, "heard the gunshots," saw an officer down, "and as the deputy is coming in, the shooter comes around this corner ... sees the deputy and shoots."
The gunman then shot a deputy in a car, who is now in critical condition, Edmonson said.
Two other officers were wounded.
"Our hearts are broken but our spirit is intact," Edmonson said.
Louisiana Gov. John Bel Edwards said Long, who was from Kansas City, Missouri, came to Baton Rouge "to do harm to our community" and specifically to harm law enforcement officers. He called it a "diabolical attack."
Edwards said the officers were "heroic" for running "towards danger in order to protect the public" and render aid to fellow officers.
The governor also noted that for six days prior to Sunday's attack there had been no arrests in Baton Rouge from the regular protests sparked by the fatal shooting of Alton Sterling by police on July 5.
Copyright © 2016, ABC Radio. All rights reserved.