The 17-year-old student who opened fire at a high school in St. Mary's County, Maryland, on Tuesday used a gun that belonged to his father, officials said Wednesday. But it's unclear still how exactly he obtained the gun.

WASHINGTON — The 17-year-old student who opened fire at a high school in St. Mary’s County, Maryland, on Tuesday used a gun that belonged to his father, officials said Wednesday. But it’s still unclear how exactly he obtained the gun.

Austin Rollins, a student at Great Mills High School, entered the school before 8 a.m. Tuesday and shot a 16-year-old girl he knew in the school hallway. He also shot a 14-year-old boy in the leg in the same hallway.

The St. Mary’s County Sheriff’s Office said in a statement Wednesday that the shooting was not a random act of violence: “Rollins and the female victim had a prior relationship which recently ended.”

The handgun Rollins used in the shooting was legally owned by his father, the sheriff’s office said. The Bureau of Alcohol, Tobacco, Firearms and Explosives helped conduct an urgent trace for the gun, but how Rollins got his hands on it is still under investigation.

The sheriff’s office is still investigating how exactly Rollins was killed when St. Mary’s County Deputy 1st Class Blaine Gaskill, the school resource officer, confronted him in the hallway during the shooting. Gaskill found Rollins still armed, the sheriff’s office said, and fired a shot. Rollins simultaneously fired a shot, but it’s also unclear if he was aiming at the school resource officer.

Officials are awaiting official autopsy results to determine if Rollins was killed by Gaskill or by his own gun.

“This is a very complex, ongoing, criminal investigation,” said Cpl. Julie Yingling with the St. Mary’s County Sheriff’s Office. School surveillance video is also being reviewed.

“We don’t want to make any assumptions. As of yet, we have found no threats made by him,” Yingling said, referring to social media posts that officials are still investigating.

The 16-year-old victim has been identified by family members as Jaelynn Willey, a member of the swim team at Great Mills. She is still in the hospital with life-threatening injuries, Yingling said.

The 14-year-old victim was discharged from the hospital Wednesday.

WTOP’s Megan Cloherty contributed to this report.

Copyright © 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, written or redistributed.