A Wisconsin high school student who police say pointed a handgun at a school resource officer and ignored an order to hand over the weapon was shot by the officer inside the school building Monday morning.

Police raced to Waukesha South School, located roughly 20 miles west of Milwaukee, soon after the incident was reported at about 10:15 a.m. Local authorities soon tweeted "the building is safe and secure" and confirmed there were no outstanding suspects, reports Fox News.

The incident unfolded after a student reported to school officials that a male student brought a handgun to school, Waukesha Police Chief Russell Jack told reporters at a news conference later Monday. He said the school resource officer "immediately responded" to the classroom and tried to secure the classroom by getting other students to safety.

Officers from the police department and sheriff's office responded to the scene and tried talking to the 17-year-old male student to "deescalate" the situation, Jack said.

The suspect "would not remove his hands" from his pocket and ignored officers' commands, according to the police chief. Eventually, he said the student removed the handgun from his waistband and pointed it at officers.

The school resource officer, an 11-year-veteran of Waukesha police, "was forced to discharge" his firearm, he said.

The student was transported to a hospital where the police chief said he was in stable condition. No police officers or other students were injured in the incident.