BOSTON (Reuters) - Massachusetts’ top court on Monday ruled the Massachusetts Institute of Technology cannot be held responsible for not preventing a PhD candidate from killing himself but said universities at times do have a legal duty to prevent student suicides.

FILE PHOTO: A man walks through Killian Court at the Massachusetts Institute of Technology (MIT) in Cambridge, Massachusetts, U.S. May 13, 2016. REUTERS/Brian Snyder/File Photo

The Massachusetts Supreme Judicial Court upheld the dismissal of a closely watched lawsuit by the father of Han Nguyen, a student who jumped to his death at the age of 25 from the top of a building at the prestigious university in 2009.

A lawyer for his father had argued that MIT knew Nguyen was a suicide risk and was negligent in not preventing his death. But the court said the student, who was enrolled in a marketing program, never told MIT employees he planned to commit suicide.

Justice Scott Kafker in the 5-0 ruling wrote that a college or university nonetheless does have a duty to prevent a suicide if it knows a student either has previously tried to take his or her own life or has stated a plan to do so.

“It is definitely not a generalized duty to prevent suicide,” Kafker wrote. “Nonclinicians are also not expected to discern suicidal tendencies where the student has not stated his or her plans or intentions to commit suicide.”

In those limited circumstances, a university must take reasonable measures such as initiating a suicide prevention protocol; getting medical attention for the student; or contacting police, fire or emergency medical personnel.

Jeffrey Beeler, a lawyer for Nguyen’s father, Dzung Duy Nguyen, in a statement said he was disappointed by the ruling but that the holding would give schools an incentive to prevent future suicides.

MIT in a statement said its students’ well-being was of “paramount importance” to it.

The case was closely watched by other schools in Massachusetts, home to many institutions of higher education.

Eighteen schools, including Harvard University and Tufts University, filed papers arguing that a ruling against MIT would unreasonably force faculty and staff without clinical expertise to secure students against harming themselves.

In court papers, Beeler said MIT faculty had discussed Nguyen’s mental health, with one professor recommending his colleagues avoid failing him because they might have “blood on their hands.”

But Kafker said Nguyen never communicated to anyone at MIT that he intended to commit suicide and made clear he wanted to keep his mental health issues separate from the school by seeking psychological help off-campus.