DIXON, Ill. (WLS) -- The suspected gunman accused of opening fire inside Dixon High School Wednesday may have gotten the gun from his mother, officials said Thursday.
According to Illinois State Police, alleged shooter Matthew Milby's mother purchased a 9 mm semi-automatic rifle in 2012. Milby used the gun in Wednesday's shooting. Police are working to determine how Milby obtained the weapon.
Milby, 19, is a former Dixon High School student. His mother said he had been ostracized at school.
During the shooting, Milby fired shots at school resource officer Mark Dallas. Dallas returned fire at Milby and was able to incapacitate him before anyone else was hurt.
According to police, Dallas ran toward the sound of gunshots and found Milby holding a gun near the gymnasium during graduation rehearsal. The two exchanged fire, and Dallas was able to incapacitate Milby.
"Everyone in our class looked at each other like, 'what was that.' I guess we all put it together it was gunshots," said Dixon senior Jahrod Bell.
Witnesses said there was a second hero during the ordeal, PE teacher and weightlifting coach Andrew McKay. Students and staff said McKay was the first to see Milby and ran to save others.
"He was stumbling in, just sprinting through the gym saying - everyone run, everyone run. So we all got up and left everything. We all just ran," said Dixon senior Charles Helfrich.
"I'm going to say thank you tomorrow," said student Hunter Pate. "I have him as a class. I'm just going to let him know how he's a hero."
Milby was the only person hurt in the incident. He was hospitalized with non-life threatening injuries and released Thursday before he was taken to Lee County Jail. Milby's mother said she was grateful to Dallas for not killing her son.
According to Dixon High School officials, Milby had enough credits to graduate with his class Sunday.
Dallas was at home Thursday under the watch of Illinois State Police.
"Mark is humbled by the tremendous outpouring of support for his actions at Dixon High School," James Mertes, an attorney representing Dallas, said in a statement. "He genuinely appreciates those who have referred to him as a hero. But Mark prefers different labels. His greatest pride stems from the titles, 'police officer,' 'husband,' and, most of all, 'dad.'"
Dixon seniors were back in the building Thursday to practice for their graduation Sunday.
"Sunday, you know, that graduation is probably the safest spot in the whole town. We're going to make sure they are taken care of," said Dixon Mayor Liandro Arellano, Jr. "They have been through enough."
The Lee County State's Attorney charged Milby with three counts of aggravated discharge of a firearm and could face more charges. His bond was set at $2 million.
Milby is due in court Friday.
"I feel like he chose the wrong path to go, instead of getting help he chose the easier way to grab a gun," said Dixon junior Sean Lahey.
Dixon, Ill., is about 100 miles west of Chicago.
WATCH: Chopper 7 HD over Dixon High School