Updated at 4.45pm

A student who shot and critically wounded two fellow students at a Maryland high school on Tuesday died in hospital after being shot by the school security officer, officials said.

St. Mary's County Sheriff Tim Cameron said a male student and a female student were wounded by the unidentified assailant. The victims are in critical condition.

"He pursued the shooter, engaged the shooter," Cameron said of the "school resource officer" responsible for security at Great Mills High School.

The reason for the shooting was unclear, Cameron said, adding, "We don't know the relationship; we don't know the motivation."

The violence was the latest in a decades-long series of shootings at US schools and colleges, coming a little more than a month after 17 students and faculty were killed in a rampage at a Florida high school.

Great Mills High School is in St. Mary's County, which is about 110 km south of Washington.

The shooting occurred amid a re-energized national debate over school shootings in the United States following the attack on February 14 at Marjory Stoneman Douglas High School in Parkland, Florida. It was the deadliest mass shooting at a US high school.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.