A gunman has died after a shooting at a high school in Maryland which left two people injured, a sheriff said.

Two students, male and female, were wounded in the shooting in a hallway at Great Mills High School, St Mary’s County sheriff Tim Cameron said.

The gunman died after a school resource officer fired at him, Mr Cameron said.

The officer and the gunman both fired a round and it was not known if the officer’s bullet killed the suspect, he added.

Deputies, federal agents and rescue personnel converge on Great Mills High School (Alex Brandon/AP)
Great Mills High School is in southern Maryland (Alex Brandon/AP)

The school resource officer is unhurt.

The male student was armed with a handgun when he wounded two others just before classes began, Mr Cameron said.

All three were taken to hospital and the gunman was later pronounced dead, he added.

Deputies and federal agents converge on Great Mills High School (Alex Brandon/AP)
Deputies and federal agents converge on Great Mills High School (Alex Brandon/AP)

The school’s principal told parents last month that it had investigated threats of a possible shooting and found they were “not substantiated”.

Jake Heibel told parents that school officials interviewed two students in February who were overheard mentioning a school shooting and found that they posed no threat. His letter was posted on local news site The Bay Net.

But Mr Heibel said the school still increased its security after social media posts about a possible school shooting “circulated quite extensively”.