The officer who confronted the Maryland school shooter Tuesday was identified as 34-year-old Blaine Gaskill, a veteran sheriff’s deputy with SWAT training.

A six-year St. Mary’s County sheriff’s deputy, Gaskill worked as a school resource officer at Great Mills High School since August.

He’s credited with stopping gunman Austin Wyatt Rollins, who shot a 16-year-old female student he’d had a prior relationship with, authorities said. A 14-year-old male student also was injured.

Gaskill and Rollins, 17, fired a shot at exactly the same time – and it’s unclear whether Rollins committed suicide or died from Gaskill’s bullet.

Rollins later died at a hospital.

Sheriff Tim Cameron said there was “no question” that the deputy’s quick response helped prevent further deaths or injuries.

“He had to cover significant ground,” Cameron said. “The premise is simple: You go to the sound of gunfire.”

Gaskill has encountered armed suspects before, according to the Washington Post.

In July 2016, he came face to face with a man with a pistol on his porch while responding to a call not far from Great Mills High School.

Gaskill can be heard on his body cam footage shouting at the man to drop his weapon. The man refuses but then complies and is arrested. No shots were fired.

The man was found guilty in February of first-degree assault and use of a firearm in the commission of a crime of violence.

Gaskill would be the second resource officer to take down an active shooter since the Columbine massacre in 1999 – if his shot is found to have stopped Rollins, the Washington Post said.

With Post Wires