LOS ANGELES — A former University of California at Los Angeles graduate student killed a woman in Minnesota before carrying two semiautomatic pistols and a grudge back to the 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, 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 so, and those who couldn't locked or barricaded classroom doors and huddled in nervous silence.

The investigation unfolded 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. A law enforcement official said that the woman was Ashley Hasti, whom documents show married the gunman in 2011.

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.”

Beck said it was Sarkar who was mentally unstable. The chief cited conversations in which UCLA officials told investigators the former Ph.D. 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 being my mentor.”

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

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

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.

He is survived by his wife and two children.