Police in the US have named the gunman who fatally shot three students at Michigan State University as Anthony McRae.

The 43-year-old, who killed himself hours after Monday’s shooting, was not a student at the university and had no known affiliation, police added.

The shooting began shortly before 8.30pm local time and left three students dead and five in critical condition after officials said shots were fired in two locations – an academic building and the student union.

Chris Rozman, deputy chief of campus police, said officials have “absolutely no idea” what the motive was, adding that McRae was not a student or Michigan State employee.

“This truly has been a nightmare we’re living tonight,” he said.

Mr Rozman added that police confronted McRae before he killed himself.

The victims killed and injured were all students and five remained in critical condition, Dr. Denny Martin, the interim president and chief medical officer of E.W. Sparrow Hospital added.

The shootings led to a campus lockdown and a manhunt that ended roughly three hours later.

Mr Rozman added that the suspect “was contacted by law enforcement off campus” at one point, adding, “that scene is being investigated as a crime scene.”

Footage filmed from a window showed panic among students as they ran away from the university buildings when the gunman was on the loose.

Governor Gretchen Whitmer, a Michigan State graduate, said at a briefing that US President Joe Biden pledged his support during a phone call.

Please use Chrome browser for a more accessible video player


0:40

Michigan shooting: People try to flee from the scene

The university has about 50,000 students, including 19,000 who live on campus.

The shooting is the latest in what has become a deadly new year in the US.

Dozens of people have died in mass shootings so far in 2023, most notably in California, where 11 people were killed as they welcomed the Lunar New Year at a dance hall popular with Asian Americans.

In 2022, there were more than 600 mass shootings in the US in which at least four people were killed or wounded, according to the Gun Violence Archive.