This May 17, 2018 photo provided by the Dixon Police Department in Dixon, Ill., shows, Matthew Milby. Milby is charged with aggravated discharge of a firearm, aggravated discharge at a school employee and aggravated discharge at a school building. Milby, who was wounded in an exchange of gunfire with a school resource officer at Dixon High School on Wednesday, May 16, 2018, has been released from KSB Hospital and has been processed into the Lee County Jail. A Lee County judge set bond at $2 million. ( Dixon Police Department via AP) (Associated Press)

DIXON, Ill. — A judge refused to lower bail Friday for a 19-year-old charged with firing shots inside of his northern Illinois high school as seniors met for graduation rehearsal, an offense a prosecutor described as one of “the most serious crimes you can commit.”

Matthew A. Milby Jr. appeared in court via video from the Lee County Jail, where he’s being held on $2 million bail. His appearance came as a tragedy was unfolding at a high school in Texas, where authorities say a 17-year-old gunman killed 10 people, including nine of his fellow students.

Police say Milby fired several shots inside Dixon High School on Wednesday before he was shot by a school resource officer. Milby, who is a senior but had not been attending classes, suffered non-life-threatening injuries. He was released from a hospital Thursday and transferred to the jail.

No one else was injured.

Milby’s lawyer, Tom Murray, asked Judge Ronald M. Jacobson on Friday to reduce Milby’s bail to $500,000, saying Milby’s criminal history is “nonexistent.” State’s Attorney Matthew Klahn objected.

Milby is charged with three counts of aggravated discharge of a firearm, and authorities have said more charges are possible. Asked by Jacobson if he understood the charges and why his bail was not being reduced, Milby nodded and said “yes, your honor.”

A lawyer for Officer Mark Dallas, who has worked at the school about 100 miles (161 kilometers) west of Chicago for five years, said in a statement late Thursday that Dallas’ son was among the seniors gathered for graduation rehearsal when the shooting occurred.

“He understands, first hand, the grave fears of parents who sent their children to school yesterday, believing them to be safe,” attorney James Mertes said. “With his actions, he has safely returned those students to their anxious parents.”

Milby’s mother bought the 9mm semi-automatic rifle used in the shooting in 2012, according to the State Police, who said they were still investigating how he obtained it.

Julie Milby has said her son was recently kicked off the football team for smoking marijuana and had been ostracized by his classmates. She said he was recently beaten up and that other students stole from him.

Sauk Valley Media reports that Milby was convicted in April for a 2017 arrest for marijuana possession of less than 10 grams of marijuana and fined $120.

He’s due in court again on Wednesday.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.