A former University of Maryland student who made online posts threatening a campus shooting rampage was sentenced to three years of supervised probation Thursday as he continues to receive court-directed mental health treatment.

Alexander Song, 19, had pleaded guilty in August to disturbing school operations and telephone misuse. As part of his plea, he admitted that he made multiple postings online in March threatening a shooting rampage at the University of Maryland, where he was then a student.

In one posting, he warned his classmates, “Don’t go around 1 o’clock to the mall,” prosecutors have said.

At a hearing Thursday in Prince George’s County District Court, Song stood with his hands crossed in front of him, his head cocked slightly to the left. Seated in the back row, his sister cried throughout the proceedings, her mother and father consoling her.

As prosecutors asked for the three-year probation term, they said Song was a “very bright individual” but questioned whether he had received enough treatment to deal with life’s daily stresses. When he made the threats, prosecutors said, he was feeling stressed because of the academic pressures of college.

“There needs to be some continued supervision,” Assistant State’s Attorney Michael Glynn said in court.

It remains unclear how serious Song’s threats were, and how capable Song was of carrying them out.

Prosecutors have said police found Song had no weapons after they searched his dorm room, his car and his family’s home. Steven Vinick, Song’s defense attorney, said in court that his client was far from the “violent monster” some have portrayed him to be, but rather a “remarkable young man” who entered college with significant Advanced Placement credits and got along well with his professors and advisers.

Vinicke said Song not only had no ability to carry out a threat — having never before held a gun — he also had no real intent to do so.

“If he could take it back, he would take it back in a New York minute,” Vinick said.

Vinick said Song was diagnosed with depression and anxiety disorder, and the threats were a response to stress. He asked the judge to give Song probation before judgment, a legal ruling that would allow him to technically avoid a conviction. Prosecutors after that said District Court Judge Patrice E. Lewis agreed to consider that request at a later date.

This item has been updated.