DIXON, Ill. (WTVO) — Matthew Milby, the man accused of opening fire during graduation practice in Dixon before being shot by School Resource Officer Mark Dallas, plead guilty in court today.

Milby plead guilty to the charges of Aggravated Discharge of a Firearm Toward a Police Officer and Aggravated Discharge of a Firearm in a School.

In exchange for his guilty plea, the court dismissed all other charges against him including Attempted Murder.

Milby is set to be sentenced on October 4th.

Milby was deemed unfit for trial previously in both 2018 and 2019.

Milby is accused of bringing a 9mm semi-automatic rifle to Dixon High School graduation practice and exchanging gunfire with the school resource Officer Mark Dallas on May 16th, 2018.

Milby can be seen in surveillance video at the high school firing in the lobby and then running away.

In court, several people testified about what happened that day, including the principal, the gym teacher, and Officer Dallas.

Dallas said he told Milby to put the gun down and told the judge while running, Milby fired at him over his shoulder. Dallas returned fire, hitting Milby.

Milby pleaded not guilty to the charges on May 18, 2018.