The officer and the student both fired a single shot at that point, and it wasn't immediately clear whether he took his own life or was killed by the officer's bullet, St. Mary's County Sheriff Tim Cameron said.
The 16-year-old girl was hospitalized in a life-threatening condition with critical injuries, the sheriff said. A 14-year-old boy also suffered a gunshot wound — it wasn't clear who shot him — and was in stable condition. The officer, who doubles as a SWAT team member, was unharmed.
Politicians responded swiftly, acknowledging that this shooting increases the pressure for action against gun violence as anger swells nationwide over the Valentine's Day killings of 17 people at a Florida high school by a teenager with an assault weapon.
The sheriff also praised the officer, Deputy Blaine Gaskill, a six-year veteran in his first year at the high school, for containing the situation in less than a minute.
'He had to cover significant ground,' Cameron said. 'The premise is simple: You go to the sound of gunfire.'
The shooter was identified as Austin Rollins, 17. His motive wasn't immediately clear. 'There is an indication that a prior relationship existed between the shooter and the female victim,' the sheriff said.
Cameron said Gaskill was stationed inside the school, pursued the shooter and fired a single round. He said it wasn't immediately clear whether that bullet hit Rollins, or the boy who was injured.
'Simultaneously the shooter fired a round as well. So, in the hours to come, in the days to come, through a detailed investigation, we will be able to determine if our SRO's round struck the shooter.'
Agents with the FBI and the Bureau of Alcohol, Tobacco, Firearms and Explosives joined deputies at Great Mills High School as students endured a lengthy lockdown, cowering inside classrooms and a locker room while officers worked to make sure there were no more threats on campus.
Police eventually kicked in the locker room door, said Ziyanna Williams, a 14-year-old ninth-grader.
'They came in with guns, and they probably thought there might be another shooter, of course,' she said. 'About an hour or two later they came -- more police came -- and told us they would search us and search our bags and stuff.' Eventually, the students were escorted outside.
The school has about 1,600 students and is near the Patuxent River Naval Air Station, about 65 miles (104 kilometers) southeast of Washington. On Tuesday, ambulances, fire trucks and other emergency vehicles crowded the parking lot and the street outside, where about 20 school buses lined up in the rain to take students to nearby Leonardtown High School to be picked up by their parent or guardians.
Democratic Rep. Steny Hoyer praised the first responders, saying the officer at the school 'answered the call this morning with swiftness, professionalism, and courage.' He said it's now for Congress to take action.
'We sympathize. We empathize. We have moments of silence. But we don't have action,' Hoyer said. 'Wringing our hands is not enough.'
Sen. Ben Cardin, D-Md., also spoke to reporters near the high school, and expressing anger and saying that at a minimum, universal background checks and a ban on assault-style weapons are needed. He said he believes momentum is building for reform, fueled by student activism.
'These students are literally just not taking 'no' for an answer,' Cardin said. 'I can tell you that Americans are listening to our students. I think our political system will respond.'
Maryland's Senate joined the House on Monday night to ban bump stocks, which enable a semi-automatic rifle to mimic a fully automatic weapon. Teachers' union leaders issued statements Tuesday saying more policies must be changed nationwide to keep schools safe.
Republican Gov. Larry Hogan, meanwhile, accused the Democrat-led legislature of failing to take action on 'one of the most aggressive school safety plans in the country.'
'We've got to take action,' Hogan said. 'We're going to try to get something done in Annapolis.'
Many students across the country are calling for effective gun controls, leading up to Saturday's March For Our Lives rally in the nation's capital against gun violence in schools. The violence hasn't abated since the massacre in Parkland, Florida; A high school student in Birmingham, Alabama, was killed this month when a classmate fired a gun inside a classroom. Threats against schools have proliferated as well, and Great Mills High has not been immune.
Just last month, the school's principal, Jake Heibel, told parents in a letter posted on the local news site The Bay Net that two students were interviewed after they were overheard mentioning a school shooting, and they were found to pose no threat. Heibel said the school increased its security nevertheless after social media posts about a possible school shooting 'circulated quite extensively.'
Also last month, St. Mary's County Sheriff's office said it arrested two teenage boys for 'Threats of Mass Violence' and a 39-year-old man on related charges after the teens made threats about a potential school shooting at Leonardtown High School, a high school about 10 miles from Great Mills. Police said they obtained a search warrant that led to them finding semi-automatic rifles, handguns and other weapons, along with ammunition.
'This is what we prepare for and this is what we pray we will never have to do,' the sheriff said Tuesday. 'The notion that it can't happen here is no longer a notion.'