The man -- whose name has not been disclosed -- parked in front of Kelly Elementary School in Carlsbad shortly after noon, got out of his car and started firing a .357-caliber handgun on a sidewalk adjacent to the school playground, inflicting minor wounds on two children, police said.
An eyewitness, Ed Willins, told the Los Angeles Times he saw construction workers take the shooter down.
"They were on him immediately," said Willins. "They administered a little street justice on him before the cops got there."
One of the construction workers, Carlos Martinez, told the newspaper the man appeared to be trying to reload his weapon when Martinez got in his truck and ran the gunman down.
"My reaction was to get him. Get him away from the kids," Martinez said.
He said he and two co-workers held the man down until police arrived.
Carlsbad Police Department Lt. Kelly Cain said two students received medical treatment for minor wounds. The children were airlifted to Rady Children's Hospital.
The bomb squad was summoned to the scene to evaluate a propane tank found in the man's car, the Times reported.
Celebrity Breakups and divorces of 2014 [PHOTOS]