The victim, a 14-year-old boy, was hit in the arm and was in stable condition at a hospital.
He was found at 6:30 p.m. Friday, May 11 in the 14400 block of Pioneer Boulevard by Norwalk Station Sheriff's deputies who responded to an assault with a deadly weapon call, said Deputy Tina Schrader of the Los Angeles County Sheriff's Department.
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.
A message posted to Highland High School principal's Twitter account urged everyone to stay clear of campus.
Garret Root, a teacher at the school, told KNBC-TV he was walking up to the school when he saw a group of students running away and asked them what was happening.
The shooting prompted an immediate lockdown at the school. It said authorities had said at least one person was hurt in the incident.
Investigators say the shooting stemmed from a dispute between the 14-year-old and the victim.
The school remained on lockdown Friday morning as school officials worked to reunite students with their parents.
"We are all concerned about the safety of our children", Palmdale School District Superintendent Raul Maldonado said in an alert.
Highland High students were evacuated and brought to the Antelope Valley Mall. He didn't elaborate. The injured student is expected to make a full recovery.
Palmdale, a city of about 150,000 people, is in Los Angeles County, about 40 miles north of downtown Los Angeles.
About a half hour later, calls were received about "shots fired" near Manzanita Elementary School, around eight miles to the west, the sheriff's department reported, adding that officers found no evidence of a crime there.
The first of more than 100 calls to 911 came at 7:03 a.m., McDonnell said.