(CNN) -- In Illinois, the Dixon High School student who opened fire at school was sentenced to 30 years in prison Tuesday.Â
Matthew Milby, now 23-years-old, fired a gun during graduation practice 5 years ago. He had a shootout with the school's resource officer Mark Dallas.Â
Dallas shot Milby twice and no one else was hurt. During the incident, Milby also shot at a teacher.Â
In a plea deal earlier this year, Milby pleaded guilty to aggravated discharge of a firearm toward a police officer and aggravated discharge of a firearm in a school.Â
He apologized in court Tuesday, before his sentence was read.Â
"My actions on 16th May 2018 were wrong and I'm here to take responsibility for what I did. I understand how many my actions have impacted Officer Dallas, Mr. McKay, my classmates and their parents and community. I cannot undo what I did, but I can take responsibility and apologize to those that were hurt by my actions. I'm sorry. I know that I have mental health issues and that I need medication to help me. It wasn't until I was placed on... that things started to make sense. I know that I need to continue treatment and I will probably need to get a residential treatment... when I'm released, I want to continue to get better. I want to apologize to my family, my mother, most, father, brother and sister," said Milby.
He went on to say, "I know how hard this has been for them, for them. Um, I let I let them down. I know that I have a long road ahead of me and that treatment is part of that process. I cannot undo what I did. But I can hope that this statement brings some peace to those that were affected by my actions."
Milby had been in the custody of the Illinois Department of Human Services since May 2021 after being deemed unfit for trial twice, once in 2018 and again in 2019, due to mental illness.
Milby was given two sentenced of 30 years each, but they'll be served at the same time. He will only have to serve 85% of it. So, Milby could be freed from prison after about 25 years.Â