MONTGOMERY COUNTY, Md. (DC News Now) — The student charged in a high school bathroom shooting that took place in January was sentenced in court Thursday.

A judge gave Steven Alston Jr., 18, of Gaithersburg a sentence of 40 years in prison, suspending all but 18 of them. Additionally, Alston will be on probation for five years after his release.

Alston entered a guilty plea to Attempted First Degree Murder in November. Alston was 17 years old when he shot a 15-year-old sophomore in a bathroom at Colonel Zadok Magruder High School with a ghost gun.

The sophomore, who had critical injuries, survived the shooting.

The school went into a full lockdown as a result of the shooting. Police found Alston, who was a junior at the time, inside a classroom and took him into custody.

While Alston is in prison, he will be admitted to into the Patuxent Youthful Offender Program.