The FBI has launched a domestic terrorism probe into the deadly shooting at the Gilroy Garlic Festival in California after discovering that the gunman had a nationwide “target list,” officials said.

Santino William Legan’s list included religious institutions, federal buildings and political institutions involving both the Republican and Democratic parties, said John Bennett, the bureau’s special agent in charge in San Francisco. It also mentioned the festival.

He declined to provide specifics on the targets but said authorities were reaching out to notify them, according to the LA Times.

Legan, 19, opened fire with an AK-47-style assault rifle at the popular food festival on July 28, killing three people, including a 6-year-old boy and a 13-year-old girl. Thirteen other people were wounded in the rampage.

Gilroy Police Chief Scot Smithee initially told reporters that Legan was quickly shot dead by three cops – but on Friday, the Santa Clara County Medical Examiner’s Office said the official cause of death was a self-inflicted gunshot wound.

Bennett said authorities still have not determined a motive for Legan’s attack.

“We have uncovered evidence that the shooter was exploring violent ideologies,” he said, adding that authorities have not determined whether Legan was a white nationalist, but that they have not ruled it out either.

Investigators also are trying to determine who Legan may have been in contact with before the attack and whether anyone helped him plan it, Bennett said.

He said previously that there was no indication Legan targeted festival attendees of a particular race.

Shortly before his attack, he promoted on Instagram a 19th-century screed often supported by white supremacists — and used a slur to refer to mixed-race people.

Meanwhile, mourners on Tuesday packed a California church for the funeral of Keyla Salazar, 13, who was killed at the garlic festival.

Friends and family members used colored markers to write messages on her casket at Our Lady of Guadalupe Church in San Jose. Relatives wore T-shirts with a photo of a smiling Keyla with a crown of small pink paper flowers.

One message read: “Keyla, you’re an angel. We will never forget you!”

Also killed were Stephen Romero, 6, and Trevor Irby, 25.

Authorities also are investigating the Saturday shooting that killed 22 people at a crowded Walmart in El Paso, Texas, as a domestic terrorism case.

Prosecutors say they will seek the death penalty for the accused gunman, Patrick Crusius.