ST. MARY'S COUNTY, Maryland - A student who opened fire at a Maryland high school died Tuesday morning, the police said. The campus was on lockdown as deputies and federal agents converged on the crime scene at at Great Mills High School.

St. Mary's County Sheriff Tim Cameron said a student shot two other students in a hallway before classes began Tuesday morning.

A school resource officer then faced off with the shooter, the sheriff said. Each fired one shot simultaneously. Cameron announced at a press conference that the gunman later died from his wounds. He said that the investigation would determine whether the round the officer fired hit the shooter.

A wounded female student was listed in critical condition, Cameron said. A wounded male student was listed in stable condition.

The St. Mary's County Public Schools said the situation was "contained" after the shooting at Great Mills High School, which has about 1,600 students and is near the Patuxent River Naval Air Station, about 65 miles southeast of Washington.

Student Mollie Davis told CBS News over Twitter that she heard what sounded like a loud balloon pop.

"I was in my classroom and heard everyone screaming," Mollie said. "I've never heard people sound so scared."

Police officers told students that the threat was over and the school would be evacuated soon, the student said.

The Baltimore Sun reported that a student said the shooting happened around 8 a.m. Terrence Rhames, 18, told the Sun that he heard a gunshot and saw a girl fall as he ran for an exit. "I just thank god I'm safe," Rhames said. "I just want to know who did it and who got injured."

The county sheriff said deputies were on the scene and told parents or guardians to stay away, urging them to go instead to Leonardtown High School to reunite with Great Mills students there. The Bureau of Alcohol, Tobacco, Firearms and Explosives tweeted that its agents are going to the scene. FBI agents were also responding to the school.

Maryland Gov. Larry Hogan and Rep. Steny Hoyer tweeted that they're monitoring reports and urged people to follow the instructions of local law enforcement at the scene.

© 2018 CBS Interactive Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.