St. Mary’s County Sheriff Tim Cameron identified the shooter in a news conference as Austin Wyatt Rollins, 17, a student at Great Mills High School in southern Maryland, where the incident occurred.
Julie Yingling, a spokesman for the sheriff’s office, confirmed the shooter’s death to PEOPLE.
The shooter and an injured female student may have had a “prior relationship,” the sheriff said.
Both the shooter and the resource officer simultaneously fired one shot at each other, but it’s not yet known whether the officer’s bullet struck the shooter, and surveillance video will be reviewed to learn whether the shooter may have been fatally injured by a self-inflicted gunshot, the sheriff told reporters.
“Early this morning at the beginning of school hours a male student produced a handgun in one of the hallways and shot another female student. There was also an additional student who was wounded in that same hallway,” Cameron said in an earlier telephone interview with WUSA9.
The sheriff’s department’s school resource officer on scene was quickly alerted, Cameron said. “The shooter and the SRO exchanged shots, and the incident ended there,” the sheriff said.
“In this case we can say unequivocally that his response, his immediate response and engagement — we can only guess what the intent was. That stopped any further assault and attack on any other students.”
Those injured included the girl, 16, who was stabilized and taken to UM Prince George’s Hospital Center, and a 14-year-old boy whose condition was listed as “good,” according to a statement released by Medstar St. Mary’s Hospital.
Asked specifically if there was a romantic relationship between the shooter and the female, the sheriff said, “That obviously, as this plays out over the next hours and days, will be part of a very detailed investigation.”
The incident prompted an immediate code red lockdown at the high school, as announced by St. Mary’s County Public Schools in an online statement early Tuesday.
A representative for the school district previously PEOPLE the incident remains under investigation.
In February, police investigated the threat of a shooting at the school that circulated on Snapchat, TheBayNet.com reported.
“We’re reeling as a community, as an agency,” Sheriff Cameron said following Tuesday’s incident. “I mean, this is your worst nightmare. You train for this, you prepare for this, and you hope that you never have to come to that reality and respond to this.”
“I pray for the victims, as our community does,” he said.
This article originally appeared on PEOPLE.