NEWPORT NEWS, Va. (AP) — A teen was sentenced Friday to 10 years behind bars for shooting and wounding two fellow students at a Virginia high school last year.

A judge in Newport News, Christopher Papile, handed down a punishment that will include time in a juvenile detention center as well as state prison, The Virginian-Pilot reported.

The teen was 15 at the time of the shooting at Heritage High School in Newport News, a shipbuilding town near the Atlantic Coast.

“I can’t ignore that he brought a gun to school, got into an altercation, and decided to pull the gun out, shot it many times, hitting these two victims,” Papile said in court.

Noting that the teen fired the shots in a crowded hallway, the judge said he was “flabbergasted that it wasn’t much worse.”

A 17-year-old student with whom the teen was fighting was shot at least three times, including in the side of his face. Another 17-year-old student, an innocent bystander who was running away, was struck in her leg. Both students have recovered from their wounds, according to court documents.

Prosecutors had asked the judge for a 10-year sentence, while public defenders requested five years in a juvenile detention center.

The judge noted that the teen had already been charged with shooting someone else — and had pleaded guilty — at the time of the shooting at the high school.

“It wasn’t the first time he had taken out a gun and shot somebody,” Papile said.