A 14-year-old used a rifle to shoot a classmate in the arm Friday at Highland High School in Palmdale and dumped the gun in the desert before he was caught in a shopping center, authorities said.
The shooting was sparked by a dispute between the two students, officials said.
Investigators were still trying to determine a specific motive.
The victim was taken to the hospital and is expected to make a full recovery, said Nicole Nishida, a Los Angeles County sheriff's spokeswoman. She said the suspect was found in the shopping center.
Garret Root, a teacher at the school, told KNBC-TV that he was walking up to the school when he saw a group of students running away and asked them what was happening.
"They said there was a shooter," Root said. "At first I didn't believe them, but then I heard a gunshot.
He said he saw what looked like a boy, about 100 yards away, carrying a long gun.
Los Angeles County Sheriff's Department deputies responded to the school about 7 a.m. after reports of a man with a gun.
Sheriff's officials said they believe the incident was an "isolated shooting."
The lockdown at the school was lifted several hours after the shooting and school officials said they would begin reuniting students with their parents.
The FBI and agents from the Bureau of Alcohol, Tobacco, Firearms and Explosives also responded to the scene.
Antelope Valley College canceled all classes and closed its campus sites until noon Friday "in an abundance of caution" following the incident.
"All services will reopen at noon and resume with normal hours for the rest of the day and weekend," school officials said in a statement.
In a separate incident at about 7:30 a.m., Palmdale deputies responded to Manzanita Elementary School, several miles east of Highland High School, after reports of gunshots being heard in the area.
Officials said deputies searched the elementary school and found no evidence of a shooting.
Editor's note: This story has been updated with a correction from the sheriff's department regarding the ages of the victim and suspect, as well as the background on the suspect.
This story has been updated.