Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The Maryland teenager who terrorized his high school used his father's handgun to shoot a girl he'd just broken up with and another classmate, investigators said Wednesday.

Austin Wyatt Rollins, 17, was later killed when he traded shots with the school resource officer at Great Mills High School, they said.

"Rollins and the female victim had a prior relationship that recently ended," the St. Mary's County Sheriff's Office said in a statement. "The handgun utilized by Rollins in the shooting was legally owned by Rollins' father."

Rollins' alleged target, 16-year-old Jaelynn Willey, remains in critical condition at a local hospital. But a 14-year-old boy who happened to be in a hallway when Rollins opened fire was released after being treated for a gunshot wound to the leg.

It was not clear how the teenager, who lived in Lexington Park, Maryland, got hold of his father's weapon or what make or caliber it is.

The Maryland shooting happened as a national debate is underway on how best to protect students from gun-toting attackers. It was rekindled by the Valentine’s Day massacre of 17 students and staffers at Marjory Stoneman Douglas High School in Parkland, Florida.

The quick response of St. Mary’s County Sheriff’s Deputy Blaine Gaskill, who had been assigned to the school last year, stands in stark contrast to that of Parkland school safety officer Scot Peterson, who resigned amid reports that he went AWOL when the shooting started.

Deputy First Class Blaine Gaskill, a school resource officer who engaged a shooter at Great Mills High School in Great Mills, Maryland on March 20, 2018. St. Mary's Sheriff's Office via AP

The National Rifle Association has been quick to point to Gaskill as proof that armed guards and teachers are a better deterrent than gun control. But Gaskill faced a teenager armed with a handgun, not a rifle like the Parkland shooter.

Nevetheless, what Gaskill is reported to have done is extremely rare.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The Washington Post, which has done an analysis of dozens of school shootings, reported Wednesday that Gaskill would only be the second school resource officer to kill an active shooter since the 1999 Columbine High School massacre.

In the aftermath of the Parkland mass killing, President Donald Trump has called for arming teachers — an idea praised by the NRA and dismissed as a “colossally stupid idea” by many educators and school safety advocates.

Still, Florida Gov. Rick Scott last month inked a new law that defied the NRA by raising the age to buy all firearms to 21 and imposed other gun-buying restrictions — but also allowed trained school workers and teachers to arm themselves.

Meanwhile, Gaskill got a shout out Wednesday from Stephen Willeford, who was praised in November after he fatally shot the gunman who'd killed 26 people at a Texas church in Sutherland Springs.

Stephen Willeford listens during a prayer vigil for the victims of the Sutherland Springs church shooting on Nov. 8, 2017 in Floresville, Texas. David J. Phillip / AP

In a telephone interview with NBC News, Willeford said he would “be honored to shake the hand" of Gaskill.

“I think what he did was outrageously courageous and needed to be done,” said Willeford, an NRA gun instructor. “He’s a true hero who put his life on the line. I would love to meet him. I think that would be excellent.”

Asked if he had any advice for Gaskill now that he’s in the public eye, Willeford chuckled and said “no.”

“He’s another good guy with a gun,” he said, repeating a phrase that is part of the NRA's mantra about armed citizens being the only thing "that can stop a bad guy with a gun."

Willeford is not likely to get any argument on the good guy part from Gaskill’s boss, Sheriff Tim Cameron, or Maryland Gov. Larry Hogan. Both have praised the 34-year-old “tough guy” for putting his own life on the line Tuesday.

“While it’s still tragic, he may have saved other people’s lives,” Hogan said of Gaskill in the aftermath of Tuesday’s shooting.

Gaskill has yet to make a public statement.

Willeford's brush with fame came after he pursued Texas church shooter Devin Patrick Kelly and shot him dead. He used a rifle similar to the Ruger AR-556 that Kelley used to commit the massacre.

It was later revealed that Willeford was a longtime NRA gun instructor — so the powerful gun lobby, which has been fighting attempts to ban such weapons, was quick to dub him as their kind of hero.

They did the same for Gaskill on Tuesday.

"This [Great Mills High School] armed school resource officer, you're not hearing anyone in #MSM talk about it because it disrupts their narrative...They do take issue with defending our most vulnerable and our most innocent and as a mother I will never understand that" —@DLoesch pic.twitter.com/ZidUzaWLmD — NRATV (@NRATV) March 20, 2018

Willeford, who recently was the guest of Rep. Henry Cuellar, D-Tex., at the State of the Union address in January, has done only sporadic interview since the Nov. 5 tragedy that pulled him from obscurity.

His lawyer, Pamela Thompson of San Antonio, said that’s mostly been by design.

“First, everybody wants a piece of him and he can’t take time off from his job to do interviews,” she said. “He did what he did because of the training he had and because it was the right thing to do. He didn’t do it to be anybody’s hero.”