Angelica Nodal, whose son, Mateo, is an eighth grader at Bay Area Technology, said she had pulled up to the school to pick up her child and had found another parent screaming that there had been a shooting. As parents around her dialed 911, she said, she struggled to contain her alarm.

“It’s scary,” she said. “There’s kids, not only mine in there. Everyone matters in there.”

Mr. Feldman said a guard at the charter school had been shot in the leg. He also said one of his administrators, Ryan Hughes, had rushed to a student’s aid, applying pressure on a wound to stem the bleeding. “He pressed,” Mr. Feldman said. “He put his hands on him to make sure that he could be OK.”

Matthew Benjamin, a high school teacher at Bay Area Technology School, said he had been walking down a hallway when he heard what sounded like gunshots, one after another, right around the corner.

“It was a blur,” Mr. Benjamin said. “I just instinctively turned around. I jumped back into the classroom; I told everyone get down. Kids were starting to flip out, and I grabbed hold of the door.”

He said he had yelled at students to “get down.” Mr. Benjamin’s class locked the windows and hunkered down for about an hour.

Across the hallway, Sherman Moore, a science teacher, heard what he thought were fireworks. But he told his students to stay quiet, just in case.

Then a voice came on the intercom saying that the school was being locked down.

The students pushed tables and chairs up against the doors and waited, hoping for the best. About an hour later, police officers knocked on the door and evacuated everyone.