A coroner's report on the gunman who opened fire at the Gilroy food festival in Northern California last Sunday night said he committed suicide, contrary to police accounts that law enforcement killed him.

Nicole Lopez, a senior office specialist in the Santa Clara County Medical Examiner-Coroner's Office, said Friday that Santino William Legan, the 19-year-old gunman who killed three people and wounded at least 12 others, died from a self-inflicted gunshot wound, according to The Associated Press.

GILROY GARLIC FESTIVAL SHOOTER SHOULD 'ROT IN HELL' SAYS NEVADA BUSINESSMAN WHO REPORTEDLY SOLD GUN TO KILLER

Gilroy Police Chief Scot Smithee told reporters Monday that the gunman had used an "AK-47-type" rifle to fire at officers before they killed him.

Smithee said three officers -- among those already at the event to provide security -- were able to shoot and kill the suspect “despite the fact that they were outgunned with their handguns against a rifle.”

He added that the officers engaged the gunman less than a minute after the first shots rang out. “It could have gotten so much worse, so fast,” Smithee said.

CLICK HERE FOR THE FOX NEWS APP

Legan gained access to the festival and bypassed security by cutting through a fence near a creek area. Firing in apparently random fashion, he killed 20-year-old Trevor Irby, 13-year-old Keyla Salazar and 6-year-old Stephen Romero.

Police have not been able to determine the suspect's motive or if the victims were part of a targeted attack.

The Associated Press contributed to this report.