WJLA
Now playing
01:00
Two injured in Maryland school shooting
Jason Seaman, a seventh grade science teacher at Noblesville West Middle School in Noblesville, Ind., speaks to the media during a press conference Monday, May 28, 2018. Seaman tackled and disarmed a student with a gun at the school on Friday. He was shot but not seriously injured. (AP Photo/Michael Conroy)
Michael Conroy/AP
Jason Seaman, a seventh grade science teacher at Noblesville West Middle School in Noblesville, Ind., speaks to the media during a press conference Monday, May 28, 2018. Seaman tackled and disarmed a student with a gun at the school on Friday. He was shot but not seriously injured. (AP Photo/Michael Conroy)
Now playing
01:17
Teacher who stopped school shooter speaks out
KTRK
Now playing
01:59
Mom: I told my daughter, 'run, baby'
Pres. Donald Trump reacts to the shooting at Santa Fe High School in Texas
CNN
Pres. Donald Trump reacts to the shooting at Santa Fe High School in Texas
Now playing
01:45
How Trump responds to shooting attacks
A target sheet hangs at a shooting range July 22 in Aurora, Colorado.
Getty Images
A target sheet hangs at a shooting range July 22 in Aurora, Colorado.
Now playing
02:20
How police train for active shooter response
Handguns that were swapped for gift cards during a Los Angeles Police Department sponsored gun buyback event in Los Angeles, California on December 13, 2014.  The city held the event in three locations and the public were able safely and anonymously surrender firearms in exchange for $100 and $200 gift cards.    AFP PHOTO/MARK RALSTON        (Photo credit should read MARK RALSTON/AFP/Getty Images)
MARK RALSTON/AFP/AFP/Getty Images
Handguns that were swapped for gift cards during a Los Angeles Police Department sponsored gun buyback event in Los Angeles, California on December 13, 2014. The city held the event in three locations and the public were able safely and anonymously surrender firearms in exchange for $100 and $200 gift cards. AFP PHOTO/MARK RALSTON (Photo credit should read MARK RALSTON/AFP/Getty Images)
Now playing
02:19
Survivors of gun violence are fed up
VR shooting
HLN
VR shooting
Now playing
02:12
Virtual reality puts teachers inside shooting
sheriff tim cameron
CNN
sheriff tim cameron
Now playing
01:29
Sheriff details Maryland school shooting
CNN
Now playing
00:59
Student speaks while on lockdown
Isabela Barry documents her first day back to Marjory Stoneman Douglas High School after the school shooting.
Isabela Barry documents her first day back to Marjory Stoneman Douglas High School after the school shooting.
Now playing
04:29
Go with students inside Parkland school
Emergency crews respond to Marshall County High School after a fatal school shooting Tuesday, Jan. 23, 2018, in Benton, Ky. Authorities said a shooting suspect was in custody. (Ryan Hermens/The Paducah Sun via AP)
Ryan Hermens/The Paducah Sun/AP
Emergency crews respond to Marshall County High School after a fatal school shooting Tuesday, Jan. 23, 2018, in Benton, Ky. Authorities said a shooting suspect was in custody. (Ryan Hermens/The Paducah Sun via AP)
Now playing
01:02
2 killed in Kentucky school shooting
Facebook photo of Bailey Holt.
From Facebook
Facebook photo of Bailey Holt.
Now playing
01:27
Shooting victim called her mom before she died
KCRA
Now playing
01:21
California gunman kills 5, wounds 10
Mattoon High School
Now playing
01:00
Hero teacher tackles student gunman
san antonio teachers self defense course_00002301
san antonio teachers self defense course_00002301
Now playing
01:27
Teachers trained to take down killers
(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.

Deputy Blaine Gaskill (left), seen here in a photo taken in 2012 and posted on the St. Mary's County Sheriff's Office Facebook page.
St. Mary's County Sheriffs Office
Deputy Blaine Gaskill (left), seen here in a photo taken in 2012 and posted on the St. Mary's County Sheriff's Office Facebook page.

Police say Rollins shot two people with one bullet in a school hallway just before classes began. He shot Jaelynn Willey, 16, in the head – and the bullet also struck a 14-year-old boy in the leg, police said.

Gaskill responded to the scene in less than a minute, and confronted Haskill in a hallway three minutes after the shooting, the sheriff ‘s office said.

About 30 seconds later, Rollins and the officer fired simultaneously, the sheriff’s office said.

Willey died after being taken off life support on Thursday, two days after the shooting. The injured boy was discharged from a hospital a day after the shooting.

Great Mills High School is in Great Mills, about 70 miles southeast of Washington.

Police said Rollins, the shooter, had a “prior relationship which recently ended” with Willey and that the shooting was not a random act of violence. The handgun used in the shooting was legally owned by Rollins’ father, police said.

CNN’s Janet DiGiacomo, Carma Hassan and Dianne Gallagher contributed to this report.