BALTIMORE — A lawsuit accusing a Maryland college of ignoring signs that a student was violent will go forward after a judge refused Monday to dismiss it, saying there were warnings before the student attacked a visitor with a baseball bat.

About a week after the 2012 attack at a campus dorm, the Morgan State University student, Alexander Kinyua, acknowledged to authorities that he killed a man staying with his family and ate the man's heart and parts of his brain.

A lawyer for Morgan State, Corlie McCormick, asked the judge during a hearing Monday in Baltimore to dismiss the lawsuit stemming from the beating. McCormick said the beating wasn't foreseeable given Kinyua's past behavior at the school and noted Kinyua had never assaulted anyone in the past.

But the judge agreed with a lawyer for the injured visitor, Joshua Ceasar, and said the college in Baltimore should have known something was "askew" based on Kinyua's behavior. Ceasar's lawyer, Steve Silverman, cited a number of instances of Kinyua's bizarre behavior over six months leading up to the beating. He said those should have put the school on notice that Kinyua was violent.

In December 2011, for example, Kinyua punched holes in the walls of a campus computer lab, which led to his dismissal from an ROTC program. Afterward, an instructor told campus police that Kinyua was a "Virginia Tech waiting to happen." During a campus forum a month later, Kinyua made cryptic comments including a mention of "blood sacrifice." He also posted bizarre messages on his Facebook and Twitter accounts.

Baltimore City Circuit Court Judge Videtta Brown said during the hearing she doesn't believe the university is responsible for monitoring social media sites, but she suggested that Kinyua engaged in a pattern of behavior that should have put the school on notice that something was wrong.

"Our history tells us that when we get behavior like this, somebody needs to pay attention," she said.

Kinyua has already pleaded guilty but not criminally responsible for the attack on Ceasar and, as a result, has been committed indefinitely to a psychiatric hospital. Kinyua also is expected to plead guilty but not criminally responsible to killing 37-year-old Kujoe Bonsafo Agyei-Kodie of Ghana, who had been staying with his family. A plea hearing in that case in Harford County is set for Aug. 19.

The judge suggested Monday it was hard to forget the events that transpired after the beating.

"We all know that this did not end well, not only for Mr. Ceasar," she said.