Maryland school shooting wasn't random, suspect had relationship with victim 'which recently ended': Sheriff

The suspect, 17-year-old Austin Rollins, died after the shooting.

The 17-year-old boy who allegedly shot two classmates at their Maryland high school "had a prior relationship" with one of his victims "which recently ended," authorities said today.

Austin Rollins allegedly shot and injured a 16-year-old girl and a 14-year-old boy in a Great Mills High School hallway just before classes began on Tuesday. Rollins died after exchanging gunfire with a school resource officer, authorities said. It was not immediately clear if the officer or the suspect fired the fatal shot.

"All indications suggest the shooting was not a random act of violence," the St. Mary's County Sheriff's Office said in a news release today. "Rollins and the female victim had a prior relationship which recently ended."

The sheriff's office said Rollins used a handgun that was legally owned by his father.

"The investigation has not yet uncovered any public social media posts/threats made by Rollins," the sheriff's office added today.

Authorities are still interviewing people who knew Rollins, the sheriff's office said.

The 16-year-old girl was gravely injured and is in critical condition, the sheriff's office and UM Prince George's Hospital Center said today. The 14-year-old boy, who suffered a gunshot wound to the thigh, has been released, MedStar St. Mary’s Hospital said.

St. Mary’s County Sheriff Tim Cameron called the shooting "our worst nightmare."

"This is what we prepare for," he said. "And this is what we pray we never have to do."

Principal Jake Heibel said in a statement, "Words cannot express the sadness and grief that our school community is feeling right now."

"I know that we are shaken and scared after today’s events and will struggle for sometime trying to make sense of it all," Heibel said. "I do not know exactly how but we will find a way to overcome this tragedy. Now more than ever we need to stand together as a school community to love, cherish, and support one another. We have and we will continue to stay strong, stay together, and find a way to get through this."

The high school is closed for the rest of the week and will reopen after spring break on April 2. Counseling is available, the principal said.

This shooting came four days before Saturday's March for Our Lives in nearby Washington, D.C. Thousands of students are expected to descend on the nation’s capital to rally for gun control and safer schools in the wake of the deadly Feb. 14 school shooting in Parkland, Florida.

Less than one week before Great Mills High School faced its own shooting, its students were among the thousands participating in the National School Walkout, according to local news outlet TheBayNet.com.

The walkout, which marked a month since the Parkland massacre, was organized as a call on Congress to tighten gun laws.

ABC News' Dee Carden and Nataly Pak contributed to this report.