The suspect, a former student at Highland High School, was taken into custody at a supermarket by an off-duty Los Angeles police officer after the boy called his father to tell him that he had fired a gun into the air, McDonnell said.
Later on Friday, the police said that the shooting victim was in a stable condition and had suffered a gunshot wound to the arm and shoulder area.
The suspect was a "male Hispanic juvenile", the sheriff's office said, later clarifying that the weapon was a rifle that was "recovered off campus". "A bunch of kids started running out to me, towards me, with very panicked looks on their faces", Alexander said.
The suspect in custody is 14 years old, as is the victim, according to law enforcement officials.
The shooting at Highland High School in Palmdale was sparked by a dispute between the two students, officials added.More news: Bomb attacks hit three churches in Indonesia
More news: Alvaro Morata returns to Chelsea's starting lineup
More news: SpaceX launches its newest Falcon 9 rocket
"At first, I didn't believe them, but then I heard a gunshot", Root said. "Alexander, turn around, turn around, there's an active shooter.' And I didn't really have time to react to that because nearly immediately after that I heard one single gunshot very loud and very close by".
The shooting happened on the campus of Highland High School in Palmdale, California, around 7 a.m. PT, even as some students still were arriving at school.
Highland High student Katharina Smith, 16, said she was driving to the school when she saw "a ton of police racing toward school". "And he's like, 'No mom, for reals, I locked myself up". I think that's what's going to get to me. There was one shot. Los Angeles reported one person had been injured.
The high school was being searched by dogs trained to detect explosives, law enforcement sources told ABC News, as sheriff's deputies worked to calm anxious parents who had come to the school after social media reports of a shooting.