The students, ages 6 and 7, were not seriously injured, Carlsbad police Lt. Kelly Cain said. The suspect parked his car around noon, jumped a fence and opened fire as he walked across campus in the north San Diego suburb.
The suspect, a man in his 40s or 50s whose name was not released, was arrested on suspicion of assault with a deadly weapon, Cain said. He is believed to have acted alone.
"He is possibly a transient who lives in the area," Cain said. "He is not cooperating with the investigation. He probably has some mental health issues."
Cain said the suspect was believed to have been tackled by construction workers. He didn't know how many shots were fired. Terry Lynn told KNSD-TV he looked out his window to see a man park his vehicle, jump a fence and fire a .357 Magnum revolver toward a crowd of children.
"He was saying something about the president, he was ranting," Lynn said.
Lynn said he screamed, "No! No!" and rushed to the scene. By the time he arrived, construction workers had tackled the suspect. He helped restrain the man until police arrived.
"It was very chaotic," he told the television station.
Witnesses said the man appeared to be firing randomly and was holding something that looked like a gas tank. Cain said a propane tank was found near his car.
"I heard a gunshot and I ran to Room 23," said Kenny Speck, 6, who heard classmates crying. "Some kids went over the fence."
Speck's parents said it could have been so much worse.
"Who knows what could have happened?" said Tamera Wleklinski, his mother. "I am so grateful to the construction workers. They deserve lunch and free donuts for the rest of the year."
Norma Cevallas, who picked up her kindergarten son an hour earlier, was at home when she heard four shots.
"We ran into a room and stayed there," she said. "We didn't want to come out."
Jordan Sears, who was returning from a nearby lagoon, told The San Diego Union-Tribune he initially thought the man was not firing real bullets because no one fell down.
"I heard the first gunshot and turned and saw a guy with a jack-'o-lantern in his hand running and shooting at something," he told The San Diego Union-Tribune. "First there was screaming, then there was silence.
The school was placed on lockdown while parents waited for their children in a nearby park.
"It was total panic not knowing what was going on and if our children were OK," Robert Speck, 43, said after reuniting with his son.