A school resource officer exchanged shots with the 17-year-old shooting suspect at Great Mills High School Tuesday morning, according to the St. Mary County’s sheriff, stopping the shooter from injuring more students.

Gaskill EDT_1521576768520.png.jpg
Courtesy: St. Mary's Sheriff's Office

The alleged gunman was killed and two students were injured in the incident, authorities said.

St. Mary's County Sheriff Tim Cameron said the shooting happened in a hallway.

Police have identified the shooter as 17-year-old Austin Wyatt Rollins and fired at a 16-year-old female student. Another student was also hit and wounded in the hallway.

The shooting only occurred for a minute before the school resource officer Deputy Blaine Gaskill responded to the hallway confronting the shooter.

►RELATED: Gun used in Great Mills HS shooting first weapon on campus in years, data shows

They exchanged gunfire -- authorities later said Gaskill fired one round. The deputy was not injured.

“That stopped any further attack or assault or any other student,” Cameron said, of the former SWAT Team member.

At 10:41 a.m., Rollins was pronounced dead, Cameron said, after he was transported to a local hospital.

►RELATED: Social media reacts to Great Mills High School shooting

Maryland State Police and the ATF are assisting the St. Mary’s County Sheriff’s officer with the investigation.

Students were bussed from the high school to be reunited with their parents at Leonardtown High School.

This story is being updated continually. Click here for the latest updates.