VESTAL, N.Y. — Students at Binghamton University awoke one morning last week to an alert from school officials: A freshman had been stabbed in his dormitory the night before and died. Then, minutes before classes were about to begin, another alert announced that they had been canceled for the day as the police searched for a suspect.

The university had already been rattled by the murder of another student off campus weeks earlier, and now a manhunt was underway. School officials stressed that neither attack was random. Still, many students living on campus locked themselves in, waiting until the authorities announced hours later that the suspect, also a student, had been arrested in his dormitory.

“Nothing like this has happened before,” said Cindy Lin, a sophomore from Staten Island, who saw the swarm of police vehicles from her window the night before. “This is the place we call home. This is where I live most of the year. It was really scary.”

There were moments last week when Binghamton could pass for any college campus where students were racing toward the end of the semester. They crossed Peace Quad with friends, bemoaning the essays and exams that stood between them and the coming break, and they still played table tennis in the basement of the student union.