LONG BEACH, Calif.–A 17-year-old Gardena High School student who brought a gun to campus that discharged while in his backpack, injuring two students, was sentenced today to nine months in a juvenile camp.

Long Beach Juvenile Court Judge Deborah Andrews imposed the term after the teen admitted one felony count each of possessing a firearm in a school zone and discharging a firearm in a school zone, according to Jane Robison of the District Attorney’s Office.

According to police and prosecutors, the boy carried a loaded 9 mm Beretta in his backpack to school on Jan. 18. The gun fired a single bullet at 10:40 a.m. when he reached inside the backpack while in a classroom.

The bullet struck a 15-year-old boy in the neck, then hit a 15-year-old girl in the head. Both had to be hospitalized.

The teen, whose name has not been released because of his age, had been ordered last month to stand trial as a juvenile. Prosecutors unsuccessfully sought to have him tried as an adult.

In the aftermath of the shooting, Los Angeles Unified School District Deputy Superintendent John Deasy said the district would conduct an assessment of all its high schools to ensure security procedures are being enforced.