A police officer brought down gunman at an Illinois high school on Wednesday morning after the suspect opened fire.

The 19-year-old suspect, whose name has not been released, is reportedly a former student of Dixon High School where the incident took place around 8 a.m.

School resource officer Mark Dallas confronted the gunman near a gym on campus where students had gathered for a graduation rehearsal, The Daily Mail reported.

The suspect ran away and Dallas gave chase.

The gunman fired multiple times at the officer, who returned fire, wounding the suspect.

TRENDING: Watch: GOP Candidate Klacik Gets Kicked Off of 'The View' for Calling Out Behar's Blackface Scandal

No students were hit during the melee. The shooter has been taken to an area hospital for treatment with non-life threatening injuries.

This is @DixonPolice SRO officer Mark Dallas, whom students are crediting with stopping a student armed with a gun at Dixon High School this morning. https://t.co/1vuDPYCYs9 pic.twitter.com/XCBdfAKbla — WQAD (@wqad) May 16, 2018

All Dixon public schools were placed on lockdown following the shooting, Chicago’s WMAQ-TV reported.

Dixon Police Chief Steve Howell said when his officers arrived, they found students and teachers barricaded in their classrooms, blocking doors with desks and bookshelves.

Do you appreciate this officer's bravery? Yes No Completing this poll entitles you to The Western Journal news updates free of charge. You may opt out at anytime. You also agree to our Privacy Policy and Terms of Use You're logged in to Facebook. Click here to log out. 100% (1232 Votes) 0% (0 Votes)

The high school was evacuated and parents were advised to pick up students at a baseball field across from the campus.

Howell hailed Dallas’ actions, saying he saved “countless lives.”

“With shots ringing out through the hallways of the school, he charged toward 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.”

"Countless lives were saved": Officer hailed for confronting gunman at Dixon High School https://t.co/wayplxPSuA pic.twitter.com/Y8cD3nQL82 — 48 Hours (@48hours) May 16, 2018

Dixon Mayor Liandro Arellano Jr. echoed the praise.

RELATED: School Bans Pro-Police Flag After Complaints That It Is 'Racist'

Dixon Mayor: A lot of things went right today when a great many of them could’ve gone wrong. #Dixon #DixonHighschool. pic.twitter.com/MttqcWz34t — Charlie De Mar (@CharlieDeMar) May 16, 2018

“A lot of things went right today when a great many of them could have gone wrong,” he said. “Things could have gone much worse. We are deeply indebted to our officer and the actions he took today.”

Today, we should all be very thankful to school resource officer Mark Dallas for his bravery and quick action to immediately diffuse a dangerous situation at Dixon High School. — Governor Rauner (@GovRauner) May 16, 2018

Illinois Gov. Bruce Rauner tweeted, “Today, we should all be very thankful to school resource officer Mark Dallas for his bravery and quick action to immediately diffuse a dangerous situation at Dixon High School.”

We are committed to truth and accuracy in all of our journalism. Read our editorial standards.