Investigators who searched the Nevada home of the Gilroy Garlic Festival shooter found the makings of a massive attack, including a gas mask, bulletproof vest and empty boxes of ammunition, along with reading material on white supremacy and radical Islam, federal law enforcement sources said Tuesday.

The search of the apartment in the desolate town of Walker Lake, in Mineral County, also turned up a knife, a gun light, a camouflage backpack, gun pamphlets, computers and numerous electronic hard drives, an empty bottle of Valium, and a mysterious letter from “Virginia to Santino,” apparently referring to 19-year-old gunman Santino William Legan, according to copies of a search warrant released Tuesday.

The extremist reading materials were not listed among the items found during the early Monday search, but a federal law enforcement official told The Chronicle they were among paper items collected from the unit. The source was not authorized to speak to the media and asked to remain anonymous.

The search affidavit and probable cause statement remained sealed, the Mineral County district attorney said, as the FBI continues its investigation.

Legan, who grew up in Gilroy and nearby Watsonville, killed three people and injured 12 others when he opened fire with a semiautomatic rifle at the annual garlic festival Sunday evening, police said. Within a minute of firing his first shots, Legan was shot and killed by three uniformed police officers who were on patrol at the festival.

Much about Legan and what motivated his attack remains unknown, but the items found in his rented apartment, along with evidence collected in and around the festival site, paint a clearer picture of a planned attack meant to cause massive death and injury.

“We continue to try to understand who the shooter was, what motivated him, and whether he was aligned with any particular ideology,” said Craig Fair, a deputy special agent with the FBI, at a news conference Tuesday.

Gilroy police said they believe Legan acted alone, though they have not fully ruled out that a second person may have been involved. Photos and video from surveillance cameras show Legan shopping at several Gilroy stores the day of the shooting, and he was always alone, said Gilroy Police Chief Scot Smithee.

Police found a shotgun in the vehicle Legan drove to the festival site, which had been parked about a mile away, Smithee said. They also found a bag of ammunition near the creek that Legan is believed to have crossed when he entered the festival through an unguarded fence, possibly to avoid metal detectors at the main gates.

Both the WASR-10 semiautomatic rifle — an AK-47-style weapon used in the attack — and the shotgun that was found in the car were purchased by Legan in Nevada.

Legan bought the semiautomatic rifle from Big Mikes Gun & Ammo in Fallon, Nev., about 65 miles from his apartment in Walker Lake, a federal law enforcement source said. The store is a home-based business, located on a quiet suburban street in the small city. Residents of the home didn’t answer the door on Tuesday afternoon.

The source said Legan bought the Remington 870 shotgun at Juggernaut Arms on July 1, then returned to the store later that month to buy a drum magazine. It is unclear if the gunman used such a magazine in the Gilroy attack.

Investigators will need several more days to finish collecting evidence from the festival site, Fair said. Meanwhile, authorities are scouring Legan’s online activities and searching the electronic devices found in his apartment for clues to what motivated the attack.

“Reviewing digital media, historically, has been very revealing in terms of somebody’s mind-set, ideological beliefs, intentions,” Fair said. “We’ve got to get into the computers, the towers, the thumb drive, the phone, to get a holistic picture of him and who he was in touch with, what sentiments and thoughts he shared with others, what he cataloged for his own consumption.”

Legan did not have much of an online presence. But right before his attack, photos were posted to an Instagram account under his name that referenced a book associated with white supremacy. Fair said the account, which was taken down shortly after the shooting, has not yet been definitively tied to Legan.

In Nevada, meanwhile, the Mineral County sheriff said Tuesday that his department had no contact with Legan during his brief time in Walker Lake, where he lived in the middle unit in a run-down, gray stucco triplex. Walker Lake is an unincorporated outpost of a few hundred people, about 70 miles southeast of Carson City.

His neighbors there said Legan was quiet and kept to himself — which wasn’t unusual in the dusty town, where people often drift through before moving on. Marty Neff, 64, a retiree who lives next door to the apartment Legan had rented, said Legan waved to him a few times as the young man walked to the lake at the end of the town’s one main street.

But, Neff said, it’s hard to remember much about Legan because nobody ever lives in the rentals next door for long.

“They stay there until they can find someplace better to live,” Neff said, pointing up the hill to the triplex.

In interviews with investigators, one of Legan’s brothers said Legan was a loner and in the days before the shooting he gave away pieces of property to people, according to a federal law enforcement source.

As in Walker Lake, Legan did not seem to make much of an impression in Gilroy or Watsonville, where people who went to school with him said they could barely recall his name or face.

Legan attended Monte Vista Christian School in Watsonville between 2013 and 2016, before transferring his senior year to Gilroy High School, where he graduated in 2017. He’d moved to Nevada at some point after high school.

“I saw him around, but not much else,” said Sierra Myer, who graduated from Monte Vista in 2017 with about 200 other students.

Another former Monte Vista student, Anna Moreno-Takegami, said she was shocked to learn that she and Legan had attended the school at the same time, but she didn’t remember ever interacting with him.

“I was just thinking, (what if) he thought about shooting up our high school or the other high school he went to?” she said.

In Gilroy, residents are taking tentative steps toward recovery — raising money for victims, putting up signs around town thanking first responders and offering food, coffee or simply hugs to strangers who are hurting.

The community is rallying around the phrase “Gilroy strong,” even as people try to make sense of how a hometown boy from a well-known family could have struck with such violence.

“I remember the chaos,” said Gilroy Councilman Fred Tovar, who was walking around the festival with police officers Sunday when the shooting began. “At first, walking, you think it’s fireworks. And then you realize it’s more serious than fireworks, you saw people running and falling.”

Since that moment, Tovar said, Gilroy has responded, asking: “How can we help? How do we donate? What are the things we can do? Who needs a place to stay?”

At least seven victims with gunshot wounds remained hospitalized Tuesday, five at Santa Clara Valley Medical Center and two at Stanford.

Crowdfunding sites to help cover victims’ medical expenses were being shared on Twitter, Facebook and other social media. A group of local children organized a lemonade stand to raise money. The Oakland A’s announced that proceeds from sales of garlic fries and Gilroy Garlic Burgers would go toward victims and their families.

At Cal Silk, a small T-shirt printing business on Church Street, dozens of Gilroy residents waited to purchase black T-shirts with a simple message: “#GILROYSTRONG.”

Shop owners Tim and Michele Pierson are printing and selling the $20 shirts on behalf of the Gilroy Foundation and the Gilroy Downtown Business Association, which will donate the proceeds to victims of the shooting and their families.

“It’s a simple, powerful logo,” Tim Pierson said.

The couple were asked to print roughly 600 shirts. By 2 p.m. Tuesday, the organizations had asked the Piersons to print another 1,000 shirts to meet demand.

“It’s my honor to do this for those families,” Michele Pierson said. “Everyone is looking for something to do — this is my part. This is how I can give back and help. The line outside is making that point very clear, that we’re here for each other, we’re here to help each other, and we will not be broken by this event.”

San Francisco Chronicle staff writers Erin Allday, Ashley McBride and Gwendolyn Wu contributed to this report.

Matthias Gafni, Dustin Gardiner, Tatiana Sanchez and Karen de Sá are San Francisco Chronicle staff writers. Email: matthias.gafni@sfchronicle.com, dustin.gardiner@sfchronicle.com, tatiana.sanchez@sfchronicle.com, kdesa@sfchronicle.com