Los Angeles County deputies detained 14-yr-old former Highland High School student in the shooting of 15-yr-old boy, who was hit in the arm.

Students are reunited with family members outside Highland High School in Palmdale, California. (Photo: AP)

Palmdale, California: A 14-year-old boy used a rifle to shoot a former classmate in the arm Friday at their California high school and dumped the gun in a field before he was caught in a shopping centre, authorities said.

Reports of the shooting and an ultimately false report of another attack at a nearby elementary school sparked chaos, terrifying parents and drawing a massive police response in the high desert city of Palmdale in Southern California.

Police descended on Highland High School after dozens of 911 calls and some reports that there were hostages in the campus library, Los Angeles County Sheriff Jim McDonnell said.

As officers swarmed the library, more 911 calls came in reporting that gunshots were heard at an elementary school across town.

Dozens of officers with several agencies blanketed both campuses looking for possible shooters and victims. Meanwhile, Antelope Valley Hospital was told several people were dead and as many as 25 students were injured, said Dr Pavel Petrik, the trauma centre's chief of surgery.

In the end, there was just one shooting and one victim, at Highland High School, about 40 miles (64 kilometers) northeast of Los Angeles.

Los Angeles County deputies detained a 14-year-old former Highland High School student in the shooting of a 15-year-old boy, who was hit in the arm.

The shooting was sparked by a dispute between the two students, said Captain Darren Harris with the sheriff's department.

"We were very fortunate that the incident wasn't much worse than it was," McDonnell said at a news conference. "The outcome was much better than anybody could have anticipated."

Dr Petrik said the reports of multiple casualties and dozens of injuries caused the hospital to virtually shut down the operating and emergency rooms for an onslaught of victims.

"Everyone from the blood bank to the lab to radiology to everyone ... it was maybe 100 people downstairs waiting for the arrival of all of these injured children," he said. "Thankfully we only had one child that was shot."

He said the boy had surgery and was expected to be fine.

McDonnell said the 14-year-old suspect had fired multiple gunshots in a courtyard but did not elaborate on whether the teen was aiming for anyone in particular.

"Those shots, in some cases, went into an area adjacent to the courtyard where they were being fired from, so the potential was for anyone to be able to take a stray round there, whether they were aimed at or not," McDonnell said. "So a very dangerous situation."

The teen was caught about an hour later at a shopping centre after the boy called his father to say he fired his gun in the air and was headed to a grocery store near campus, McDonnell said.

He said the teen's father called a family friend who's an off-duty police officer and told him where the boy was.

The off-duty officer, who works for Los Angeles police, then detained the teen without incident. He was being held on suspicion of attempted murder.

It's unclear where he got the rifle.

McDonnell said the boy's mother had called the officer earlier in the morning to tell him she and her husband were having trouble with him and that the teen had run away.

The parents recently transferred the boy from Highland High School though it was unclear why. McDonnell declined to elaborate.

Parents and students were outside the school crying as investigators remained on campus.

Student Pualani Revis told KABC-TV that students ran into her classroom saying there were gunshots going off.

"We barricaded the room," she said. "We went to the back of it to make sure we were safe."

Johnny Lewis, whose 17-year-old son is a student at the school, told The Los Angeles Times that he raced to the campus with his wife after hearing reports about the shooting.

"We didn't know at that time if our son was in danger, injured or shot or what," he said. "It's just ridiculous with all the guns in schools. I never knew it would happen to us here."