(CNN) Although a school resource officer did fire at the teen who'd shot two fellow students at a Maryland high school last week, the shooter died of a bullet from his own gun, authorities say.

Austin Wyatt Rollins -- a 17-year-old who killed one student and injured another -- shot himself in the head in a hallway at Great Mills High School on the morning of March 20, right as school resource officer Blaine Gaskill fired his gun at him, the St. Mary's County Sheriff's Office said

The officer's shot struck Rollins' gun, which was in the teen's hand, the sheriff's office said.

Nevertheless, Gaskill's quick action -- confronting Rollins just three minutes after the teen shot two students -- has been credited with bringing the incident to a quick end. That praise came even when it was unclear which shot killed the teen.

"He responded exactly how we train our personnel to respond," St. Mary's County Sheriff Tim Cameron told reporters before investigators determined Rollins killed himself.

Read More