The suspect was apprehended near a Vons grocery store about a mile from the school, a Los Angeles County fire official said.
Authorities say the teenager dumped the gun in the desert before being caught in a shopping centre.
Officials had initially said the victim was 14 years old.
The victim was taken to a hospital and is expected to make a full recovery.
"I wish I could tell you what his motivation was or what he was looking to do", McDonnell said.
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". Students on the campus remained calm and texted their classmates, telling them to stay away from the area, and faculty members directed deputies throughout the campus, allowing them to clear the building faster, McDonnell said.
Lydia said she then heard two gunshots before she and her mom drove away.
Friday's incident comes during a time when gun control and school safety has been a national hot topic since the Parkland shooting on February 14. "I mean, it's tiresome. Our kids aren't supposed to be hurt". Authorities also set up an area to receive anxious parents who were rushing to the school to pick up their children. "I heard a whole bunch going off". "This may take a while, so your patience is appreciated".
Initial reports of a possible school mass shooting drew immediate attention from major news outlets and cable TV networks. "There was no threat to that campus whatsoever", a sheriff's official said in a press conference.