ABC News March 10, 2020

Officers cleared for opening fire on mass shooting suspect at Gilroy Garlic Festival

WATCH: Three dead in shooting at Gilroy Garlic Festival in California

Three police officers were cleared of wrongdoing Tuesday for opening fire on a mass shooting suspect last year during the Gilroy Garlic Festival in Northern California.

The Gilroy police officers "undoubtedly saved lives and prevented further bloodshed" by shooting 19-year-old Santino Legan at the July 2019 gathering, according to the Santa Clara County District Attorney's Office.

Gilroy Garlic Festival shooting victims include 6-year-old boy, teen girl and college grad

Legan allegedly killed three people -- including a 6-year-old -- and injured 17 others at the popular family food fair.

Mario Tama/Getty Images, FILE
A makeshift memorial is seen outside the site of the Gilroy Garlic Festival, July 29, 2019, the day after a mass shooting took place there, in Gilroy, Calif.

Legan was firing an AK-47-style assault rifle into the crowd and at police when the officers shot him numerous times, prosecutors said.

The officers confronted the 19-year-old less than one minute after the shooting started, prosecutors said.

'I'm a walking miracle': Gilroy Garlic Festival survivor describes how he saw shooter appear from behind snow cone truck

Legan had been struck by police multiple times when he "put the muzzle of his assault rifle to the roof of his mouth and pulled the trigger, taking his own life," prosecutors said.

Deputy District Attorney Rob Baker wrote in his report that Detective Eric Cryar, Officer Robert Basuino and Officer Hugo Del Moral placed "themselves, literally, in the line of fire," and "their actions were unquestionably lawful and justified."

Gilroy Garlic Festival shooting: Suspect Santino William Legan, 19, identified as gunman who allegedly killed 3 people

Legan fired at least 36 rounds of ammunition in his shooting spree, prosecutors said.

Trevor Irby, 25; Stephen Romero, 6; and Keyla Salazar, 13, were killed in the shooting.