A person from the Los Angeles County Department of Medical Examiner-Coroner's office removes a body at the scene of a fatal shooting at the University of California, Los Angeles, Wednesday, June 1, 2016, in Los Angeles. About two hours after the first 911 call came in around 10 a.m., with the center of campus still saturated with officers, Los Angeles Police Chief Charlie Beck said it was a murder-suicide and declared the threat over. Two men were dead in an engineering building office, and authorities found a gun and what might be a suicide note, he said. (AP Photo/Nick Ut)
A person from the Los Angeles County Department of Medical Examiner-Coroner's office removes a body at the scene of a fatal shooting at the University of California, Los Angeles, Wednesday, June 1, 2016, in Los Angeles. About two hours after the first 911 call came in around 10 a.m., with the center of campus still saturated with officers, Los Angeles Police Chief Charlie Beck said it was a murder-suicide and declared the threat over. Two men were dead in an engineering building office, and authorities found a gun and what might be a suicide note, he said. (AP Photo/Nick Ut) Credit: Nick Ut

Los Angeles — A former UCLA graduate student killed his wife in Minnesota before carrying two semi-automatic pistols and a grudge back to the Los Angeles campus, where he fatally shot a young professor he once called a mentor then killed himself, police said Thursday.

The attack came after Mainak Sarkar, 38, had composed a “kill list” with the names of the woman and two UCLA professors, police Chief Charlie Beck said.

Detectives believe Sarkar also intended to kill the second professor but couldn’t find him Wednesday on the bustling campus, Beck said.

Authorities pieced together the case as most classes resumed a day after thousands of students and staff members were locked down on the sprawling campus. Its normally tranquil paths and hallways were swarmed by a small army of officers clad in body armor and wielding high-powered rifles.

Students who could flee did, and those who couldn’t leave locked or barricaded classroom doors and huddled in nervous silence.

The investigation unfolded rapidly after Sarkar left a note in the office where he killed professor Bill Klug. It mentioned the second professor on the “kill list” and asked anyone who read it to check on Sarkar’s cat in St. Paul, Minn.

When authorities went to Sarkar’s apartment, they found the list of planned targets. Authorities checked the residence of the woman in a nearby town and found her body.

Authorities have not publicly identified the woman or the unharmed professor, who also belonged to UCLA’s engineering faculty.

Sarkar had disparaged Klug online and the professor knew of his contempt, but police have not uncovered any death threats, Beck said. The writings contained “some harsh language, but certainly nothing that would be considered homicidal,” he said.

A blog post written in March by someone identifying himself as Sarkar asserted that Klug “cleverly stole all my code and gave it (to) another student” and “made me really sick.”

The blog continues: “Your enemy is your enemy. But your friend can do a lot more harm. Be careful about whom you trust. Stay away from this sick guy.”

Beck said it was Sarkar who was mentally unstable. The chief cited conversations in which UCLA officials told investigators the former PhD student’s claims of stolen code are “a making of his own imagination.”

Sarkar and Klug were once close. In his 2013 dissertation about using engineering to understand the human heart, the student thanked the professor “for all his help and support. Thank you for being my mentor.”

Authorities believe Sarkar drove to Los Angeles from Minnesota in the past few days with two handguns he legally bought in Minnesota and with ammunition. Police working to find that car sought the public’s help, saying it was a 2003 Nissan Sentra with the license plate of 720KTW.

With the guns and ammunition Sarkar carried, “he could have caused many more fatalities than the one,” Beck said.

At Sarkar’s apartment building in St. Paul, the only people who would open their doors Thursday said they didn’t know their neighbor and that police had been there Wednesday night.

Colleagues and friends described Klug, 39, as a kind, devoted family man and teacher who coached youth baseball in his adopted hometown of El Segundo and didn’t appear to have conflicts with anyone.

“Bill was an absolutely wonderful man,” said Alan Garfinkel, a biology and physiology professor who worked with Klug.