March 20 (UPI) — Two students were injured and the shooter was killed in an attack at a Maryland high school Tuesday morning, authorities said.

The perpetrator shot a girl and a boy at Great Mills High School in St. Mary’s County, Md. — about 55 miles southeast of Washington, D.C.

Officials said the male shooter later died, following an exchange of gunfire with a school resource officer. His age and relation to the school and the injured was not immediately known.

“You train to respond to this and you hope that you never ever have to,” Sheriff Tim Cameron said. “This is the realization of your worst nightmare — that, in a school, that our children could be attacked. And so as quickly … as that school resource officer responded and engaged, there’s grievous injuries to two students.”

The motive behind the shooting is unclear and no information is available on the relationship between the shooter and the male and female victims.

The high school was put on lockdown and the St. Mary’s County Sheriff Office said the scene was “contained and safe.”

“We are closely monitoring the situation at Great Mills High School,” Maryland Gov. Larry Hogan said on Twitter, adding that state police were “in touch with local law enforcement and ready to provide support. Our prayers are with students, school personnel, and first responders.”

Great Mills High School has about 1,600 students.

Terrence Rhames, a senior at the school, said he ran to a bathroom when he heard the first shot around 8 a.m. He said he saw a girl fall out of the corner of his eye.

“I just thank god I’m safe,” Rhames told The Baltimore Sun. “I just want to know who did it and who got injured.”

The shooting occurred just days before the national March for Our Lives event, a rally for gun control inspired by the deadly high school shooting in Parkland, Fla.