A male student opened fire around 8 a.m. in a hallway at Great Mills High School, striking a female student and a male student, St. Mary’s County Sheriff Tim Cameron said during a press conference.

A school resource officer, a St. Mary’s County sheriff’s deputy assigned to the school, exchanged fire with the shooter, wounding him and ending the confrontation, Cameron said. The school resource officer was not injured.

The three students were transported to local hospitals. The shooter died hours later. The female student remains in critical condition and the male student is in stable condition, according to officials.

“The potential for other victims was very real,” Cameron said during the press conference. “You can only theorize what would have happened ... if our school resource officer hadn’t engaged immediately.”

Calling it “a relic of the 18th century,” retired Supreme Court Justice John Paul Stevens called Tuesday for the outright repeal of the Second Amendment, saying it would achieve “more effective and more lasting reform” than other efforts to curb the country’s scourge of gun violence.