A teenage school student stabbed a school resource officer in the early hours of Tuesday at a Wisconsin high school before the officer shot the student, according to police.

The incident took place just a day after a 17-year-old student was shot and wounded inside Waukesha South High School, about 20 miles (32 km) west of Milwaukee, by a police officer after bringing a handgun into the building and failing to comply with orders to surrender the weapon.

During a news briefing, Oshkosh Chief of Police Dean Smith said that West High School, about 85 miles (137 km) north of Milwaukee, was put on lockdown after the altercation.

Smith said that the student wounded the officer with an “edged” weapon. The officer then fired his gun, shooting the 16-year-old once.

Other officers arrived and began life-saving treatment on the officer and student. Some students were evacuated from the school while others sheltered in place.

The case was being turned over to state criminal investigators.

Authorities immediately gave the student first aid, stopping the bleeding. The student is in stable condition.

Police found two firearms in the classroom and say both were pellet guns. Police later searched the student’s home and found more pellet guns.

(With inputs from agency)