A school shooting has wounded two teenagers at a high school in the US state of Maryland, local authorities say.

The shooting occurred on Tuesday morning at the Great Mills High School in Lexington Park, Maryland.

A female student is in critical condition and a male student is in stable condition.

The school is attended by nearly 1,600 students, news media reports say.

The shooting ended after an armed school resource officer exchanged gunfire with the attacker, who was killed in the exchange.

Maryland Governor Larry Hogan said in a statement he and his wife were "praying for those who were injured, their families and loved ones, and for the entire Great Mills community as they come together to heal in the wake of this horrific situation".

The shooting is the latest in a series of armed assaults at schools across the US.

A 19-year-old allegedly killed 17 - mostly students - at Marjory Stoneman Douglas High School in Parkland, Florida, on February 14.

Since then, a movement led by students from the Florida high school has pushed for increased gun-control measures.

The refrain of "thoughts and prayers", as well as the biggest US gun lobby, the NRA, have become targets of ire from the student movement.

They say "thoughts and prayers" are not enough and the NRA uses its influence to stop needed reforms.

Logan acknowledged this criticism.

"Although our pain remains fresh and the facts remain uncertain, today's horrible events should not be an excuse to pause our conversation about school safety. Instead, it must serve as a call to action," his statement said.