Updated

The handgun used in a shooting at a Maryland high school was legally owned by the gunman’s father, authorities said Wednesday.

Austin Rollins, 17, brought the Glock 9mm pistol to Great Mills High School on Tuesday and opened fire, wounding a 16-year-old girl and a 14-year-old boy, the St. Mary’s County Sheriff’s Office said.

A school resource officer got to the scene within a minute and fired a shot at Rollins, but it wasn’t immediately clear whether Rollins was killed by the officer or if he took his own life. Rollins died at the hospital hours later.

rollins md 0322

This photo of gunman Austin Wyatt Rollins, 17, was posted to his Facebook in May 2014. (Facebook)

Authorities didn’t divulge any further information about the weapon, including how Rollins was able to have access to it or where it was purchased, according to the Baltimore Sun.

Maryland law bars a person from leaving a loaded weapon somewhere that could be accessed by someone under the age of 16, the newspaper reported. It is also illegal for anyone under the age of 21 to possess a handgun unless it is required for their job.

Police said the shooting appears to be the action of a lovesick teenager, but authorities admitted that a precise determination of Rollins’ motive may be impossible now that he is dead.

“All indications suggest the shooting was not a random act of violence," police said.

md great mills 0322

Investigators have failed to find any threatening posts or statements made by Rollins, the Baltimore Sun reported. (GMHS)

Investigators have failed to find any threatening posts or statements made by Rollins, the Baltimore Sun reported.

The 16-year-old girl was identified as Jaelynn Wiley and is still fighting for her life at the University of Maryland Prince George’s Hospital Center. She remained in critical condition as of Wednesday, the hospital said in a statement.

The 14-year-old boy was released from MedStar St. Mary’s Hospital, according to the Baltimore Sun.

The Associated Press contributed to this report.