DIXON, Ill. (AP) — The school resource officer authorities say stopped a gunman who began firing inside an Illinois high school says “I was not going to let him get away.”

Officer Mark Dallas told NBC’s Today Show he was in his Dixon High School office May 16 when he heard gunfire in the hallway. Dallas says he recognized the gunman and knew he needed to stop him from entering the gym, where graduation rehearsal was being held.

Dallas says he yelled at 19-year-old senior Matthew Milby Jr. and the two exchanged shots. Dallas chased Milby outside, arresting him after shooting him in the shoulder.

Dallas’ son Josh was in the gym. He says he heard his dad’s voice and “knew he would protect us all.”

Milby is being held on $2 million bail.