A student who opened fire in the hallway of a Maryland high school Tuesday targeted a 16-year-old girl after the couple recently ended their relationship, according to the St. Mary’s County Sheriff’s Office.

Austin Wyatt Rollins, 17, brought his father’s Glock handgun to Great Mills High School and shot Jaelynn Willey in a hallway just before classes began about 7:55 a.m., according to the sheriff’s office and the girl’s family.

“All indications suggest the shooting was not a random act of violence,” the department said in a statement Wednesday afternoon.

The gun Rollins used was legally owned by his father, the sheriff’s office said.

Rollins was killed after school resource officer Blaine Gaskill confronted the teen as students and staff scrambled for cover. The sheriff’s office said Wednesday that Gaskill fired one shot at Rollins, “who simultaneously fired a shot as well.”

“Rollins sustained a life-threatening injury in the exchange,” the department said.

An autopsy on Rollins that would determine the cause of death — including whether the shot that killed him came from his own gun or was fired by the school resource officer — was delayed because of Wednesday’s snowstorm, said Cpl. Julie Yingling, spokeswoman for the St. Mary’s County Sheriff.

“Hopefully, in another day or two, we’ll be able to release more information, but we’re still in the trenches of it,” Yingling said.

Details of Rollins’s life remained sparse, though the sheriff’s office said it hadn’t “uncovered any public social media posts/threats made by Rollins.”

There was no answer Wednesday at the home of Rollins’s family, and attempts to reach his parents have been unsuccessful.

Friends and neighbors described Rollins as a friendly, happy teenager who liked to play ball, skateboard and hang out with friends.

Newell Rand, a Great Mills graduate who knew Rollins, said he never expected the burst of violence from the teen.

“He was a very intelligent guy who had so much going for him,” Rand said in a message on social media.

The Enterprise newspaper in December listed Rollins as a Great Mills merit roll student.

An uncle on Wednesday identified the student injured in the shooting as Willey, one of nine children. She remained in critical condition Wednesday evening after suffering life-threatening injuries.

Willey is an “amazing young lady, whose peaceful presence and love of her fellow students and family” is well-known at the school, the uncle, Timothy Cormier, said in a statement. She is a dedicated student and swimmer, he said.

“It is hard for us not to see her shining, smiling face right now and to see her light up the room with her presence,” Cormier said, adding the family is requesting privacy.

As of Wednesday morning, an online fundraiser for Willey had collected more than $42,350 that the uncle said will go toward medical expenses.

A representative of the University of Maryland Prince George’s Hospital Center, where Willey is being treated, said details of the teen’s condition could not be released, citing patient privacy rules.

A 14-year-old boy who was in the hallway was wounded by Rollins but was released Wednesday from MedStar St. Mary’s Hospital after surgery on his thigh, officials said.

School officials said Wednesday that Great Mills will be closed through the end of the week to assist law enforcement efforts. The school is scheduled to reopen April 2, after spring break.

The school system offered counseling services for students at two nearby elementary schools.

The shooting prompted a lockdown and evacuation at Great Mills, which has more than 1,600 students. Authorities praised Gaskill, who has been a school resource officer at the high school since August, for his quick reaction.

“This is a tough guy who closed in quickly and took the right action,” Maryland Gov. Larry Hogan (R) said Tuesday of Gaskill.

The shooting at the high school 70 miles south of the District thrust the close-knit St. Mary’s County community into the national debate over gun control and whether teachers should be armed and more armed officers added to improve safety.

The shooting has prompted calls to action from the St. Mary’s community.

Rand and other Great Mills students and alumni are planning to travel Saturday to the District for the March for Our Lives, a rally against gun violence sparked by the Florida school shooting last month that left 17 people dead.

“We are trying to turn a tragedy into a learning experience,” Rand said in a message to The Washington Post via Facebook. “We hope that some form of action will be taken.”

Aaron Foreman, who was a coach at Great Mills and lives across the street from the Rollins family, posted a Facebook live video Wednesday morning urging businesses and religious organizations with vans to help take students to the D.C. rally so they could join “their brothers and sisters” from across the nation who are victims of school violence.

“We need to show our children that we believe in them and that their voices need to be heard downtown Saturday,” said Foreman, who added that a local Food Lion offered to provide food and beverages for students participating in the march so they don’t have to spend their own money.

Foreman said his daughter recently graduated from Great Mills.

“This could have been her,” he said in the video urging parents to get involved Saturday.

Students from Great Mills are expected to meet at the Branch Avenue Metro station in Prince George’s County just outside the District before heading downtown as a group, Foreman and Rand said.

lynh.bui@washpost.com

Donna St. George and Jennifer Jenkins contributed to this report.