A gunman who opened fire at Michigan State University killed three students and wounded five, sparking an hour-long manhunt as frightened students hid in classrooms and cars.
The gunman ultimately committed suicide, police announced.
Police at a press conference later Tuesday identified the attacker as 43-year-old Anthony McRae.
They said he shot himself miles away from campus as police confronted him.
Authorities previously said the shooter was neither a student nor an employee and had no affiliation with the university.
The shooting began Monday night at an academic building and then moved to the nearby student union, a popular gathering place for students to eat or study.

As hundreds of officers toured the East Lansing campus, about 90 miles northwest of Detroit, students hid where they could.
Four hours after the first shots were reported, police announced the man’s death.
“It really has been a nightmare that we’re living through tonight,” said Chris Rozman, acting deputy chief of the campus police department.
Dominik Molotky said he was learning about Cuban history around 8:15 pm when he and the other students heard a shot outside the classroom.
He told ABC’s Good Morning America that a few seconds later, the gunman walked in and fired three or four more rounds as the students took cover.
“I was ducking and covering, and the same with the rest of the students.
“He fired four more rounds and when he went quiet for about 30 seconds to a minute, two of my classmates started breaking a window and that took about 30 seconds to happen.
“There was glass everywhere,” Molotky said.
“After that, we broke the window and I got out of there, and then I booked it back to my apartment,” he said.
He wasn’t sure if the shots hit any of the students.
Ryan Kunkel, 22, was attending a class in the Engineering Building when he learned of the shooting through an email from the university.

Kunkel and 13 other students turned off the lights and acted like “there’s a shooter right outside the door,” he said.
“Nothing came out of anyone’s mouth” for more than four hours, he said.
“I wasn’t ready to accept that this was really happening on the side,” Kunkel said.
“This is supposed to be a place where I come and learn and improve myself.
“And instead, students get hurt.”
The shooting is the latest in what has become a deadly new year in the United States.
Dozens of people have been killed in mass shootings so far in 2023, most notably in California, where 11 people were killed while welcoming the Lunar New Year at a dance hall popular with older Asian-Americans.
In 2022, there were more than 600 mass shootings in the US in which at least four people were killed or injured, according to the Gun Violence Archive.
“This is a uniquely American problem,” lamented Michigan Governor Gretchen Whitmer.
Mr. Rozman, from campus police, said two people died at Berkey Hall and another at MSU Union, while five people were in critical condition at Sparrow Hospital.

Police eventually confronted the gunman, who later died from a “self-inflicted gunshot wound,” Rozman said.
“We have no idea why he came to campus to do this tonight. That is part of our ongoing investigation,” the deputy chief said.
Ted Zimbo said he was walking to his bedroom when he came across a woman with “a ton of blood on her.”
“She told me, ‘Someone came into our classroom and started shooting,’” Zimbo said.
“His hands were completely covered in blood. She was in his pants and his shoes.
“She said, ‘It’s my friend’s blood.'”
Zimbo said the woman went to find a friend’s car while he returned to his truck and covered herself with a blanket to hide for three hours.
Michigan State has about 50,000 students, including 19,000 who live on campus.
All classes, sports and other activities were canceled for 48 hours.
The university’s interim president, Teresa Woodruff, said it would be a time “to think and cry and come together.”
“This Spartan community, this family, will come together again,” Professor Woodruff said.