DIXON, Ill. -- A school resource officer is being hailed as a hero after confronting a gunman at an Illinois high school Wednesday morning, officials say. The officer encountered the 19-year-old former student, who was armed with a gun, at Dixon High School around 8 a.m., Dixon Police Chief Steven Howell said.

Howell said the suspect fired several shots near the school's west gym and was then confronted by the officer assigned to the school. The suspect fled the school and the officer pursued him, Howell said. The gunman then fired several shots toward the officer, who shot back, wounding the suspect.

The suspect was arrested just west of the school and was being treated for non-life-threatening injuries. No students or staff were injured, thanks to the actions of the officer, Howell said.

Get Breaking News Delivered to Your Inbox

"I could not be more proud of the police officer and the way he responded to the situation. With shots ringing out through the hallways of the school, he charged towards the suspect and confronted him head-on," Howell said. "Because of his heroic actions countless lives were saved. We are forever indebted to him for his service and his bravery."

Howell also praised the response of students and staff who followed training by sheltering in place and barricading classroom doors with bookcases and desks, Howell said. All Dixon Public Schools were initially placed on lockdown, but only the high school remained locked down late Wednesday morning.

Howell said there is no further threat to the school and police are confident the gunman acted alone. He said the names of the officer and the suspect are not being released.

Federal and state officials also responded to the scene in Dixon, about 100 miles west of Chicago.