CHICAGO (CBS) — The 9mm semi-automatic rifle a former Dixon High School student allegedly used to fire shots at a school resource officer on Wednesday was purchased by his mother six years ago, police said.

Matthew Milby, 19, was released from the hospital Thursday morning and transferred to the Lee County Jail, where he was being held on $2 million bail. He has been charged with three counts of aggravated discharge of a firearm, and is expected to appear for an arraignment hearing on Friday.

READ MORE: Police Respond To Shots Fired Call At Clark And Lake CTA Stop

Illinois State Police said investigators have determined the gun he used in Wednesday’s shooting was purchased by his mother in 2012. Police have not yet determined how the gun ended up in Milby’s hands.

Milby’s mother, Julie Milby, told reporters Wednesday she has no idea where her son obtained the gun.

She said recent bullying has left her son troubled.

“What was hurtful was and what this all led to was ostracization,” stated Julie Milby. “I just know that the kid’s been real sad for a long time.”

RELATED: Dixon School Shooting Suspect Charged | Suspect’s Mom: He Was ‘Real Sad For A Long Time’ | ‘A Complete Hero’: School Resource Officer ‘Saved Countless Lives’

Matthew Milby was wounded in a shootout with Dixon High School resource officer Mark Dallas outside the school auditorium Wednesday morning.

Dallas was on duty at the school at 8 a.m. when he heard several shots fired near the auditorium, where about 200 students were preparing for a graduation ceremony rehearsal.

Officer Dallas rushed to the area and confronted Milby, who fled on foot outside the school.

READ MORE: Man Found Shot In Head Under Viaduct In Stony Island Park

Milby fired several shots at Dallas, who returned fire, wounding Milby.

Parent Simone Cox told CBS 2’s Mai Martinez she was relieved her son was okay. She said she was thankful Dallas was there to stop the shooter.

“I really admire that man,” Cox said. “I’m just blessed to have my son.”

For some students who returned to the school Thursday for graduation rehearsal or to pick up belongings, being back at the building brought up painful memories from the day before.

“It gives me chills to think that yesterday could’ve been the day that I died at school, and it’s terrifying to walk back in there and see people,” sophomore TJ Munroe said.

Munroe’s classmate, Cheyanne Anderson, said being back at the school made her nervous.

“I could hear screaming again,” she said. “I could hear the teachers all in my head again. I was nervous and I was scared. I was reliving all the scenes in my head again,” Anderson said.

Students said they were grateful to be celebrating graduation with their friends this weekend instead of attending funerals.

That graduation will be held Sunday.

MORE NEWS: Four In Custody Following Domestic Incident 'Involving A Firearm' At Sky Zone In Orland Park

Police said the investigation was continuing Thursday afternoon, and Milby could face additional charges.