Los Angeles (CNN) -- The 17-year-old Los Angeles student accused of carrying a gun that discharged and struck two students in a high school this week was charged Thursday with two felonies, according to the prosecutor's spokeswoman.
The student, whose name is being withheld by authorities, was charged with possessing a firearm in a school zone and discharging a firearm in a school, said Jane Robison, spokeswoman for the Los Angeles County District Attorney's office.
The teen has been on probation since October for a misdemeanor battery charge, Robison told CNN.
The student allegedly carried an automatic handgun in his backpack into a health class at Gardena High School on Tuesday, authorites said. Prosecutors provided new details Thursday by stating that the boy was carrying a 9mm Beretta in the backpack. The gun accidentally discharged when the boy reached inside the backpack, allegedly to get something to eat, according to a statement by the district attorney's office.
A single round then struck a 15-year-old girl in the temple and a 15-year-old boy in the neck, authorities said.
Prosecutors have filed a motion to try the 17-year-old as an adult, Robison said.
If tried as an adult and convicted, he could face up to seven years in prison, Robison told CNN. If tried as a juvenile and convicted, the teen could face up to nine months in a juvenile camp, Robison said.
The boy, who remains in police custody, is scheduled to be arraigned Friday in Long Beach, California, Juvenile Court, Robison said.
The 15-year-old girl wounded in the head in the shooting was still in critical condition Thursday, said spokeswoman Julie Rees of Los Angeles County Harbor-UCLA Medical Center in Torrance, California.
The 15-year-old boy wounded in the neck was released Wednesday, Rees told CNN.
Two additional Los Angeles students -- a boy and a girl -- have been arrested in the shooting, and prosecutors are reviewing their cases, Robison said Thursday.
One of the two students is accused of changing clothes with the 17-year-old boy after the shooting, and the other allegedly took the backpack and attempted to dispose of it, authorities said.
Meanwhile, incoming Los Angeles Unified School District Superintendent John Deasy has found that 2,400-student Gardena High hadn't been performing daily random searches of students with a metal-detecting wand, in violation of district policy, schools spokeswoman Lydia Ramos said Wednesday.
The school system began checking all high schools Wednesday to ensure they are following the daily "random wanding" policy, said a schools spokesman, Robert Alaniz.
The 15-year-old girl with the head wound had surgery for a brain injury caused by the shock wave of the bullet, doctors said. Surgeons removed a piece of her skull to allow for brain swelling, which happens in the 48 hours after such an injury, doctors said.