MINNEAPOLIS (WCCO) — The man accused of walking into the Allina clinic in Buffalo and opening fire Tuesday had threatened a mass shooting there just years earlier.

Suspect Greg Ulrich is in the Wright County Jail. He is expected to face charges of murder and four counts of attempted murder and possession of an explosive device. The 67-year-old lived in Buffalo. His extensive contact with law enforcement spans nearly two decades.

READ MORE: Sheriff: 1 In Custody, 1 At Large In Connection To 4 Minnesotans Found Dead In Wisconsin

Documents show Ulrich’s conflict with Allina goes back to at least 2018. It includes threats of a mass shooting and a doctor who said Ulrich is a threat to himself and society.

The Allina clinic in Buffalo where the shooting happened knew Ulrich. According to documents, in 2018 a doctor working there became so concerned about his behavior he called police about his mental health. The report shows Ulrich “talked about shooting,​ blowing things up,​ and practicing different scenarios of how to get revenge.”

The doctor told police Ulrich is angry with the medical community and “is a threat to himself and society.” Ulrich reportedly made comments about Buffalo, Abbott, Duluth and Rochester. And that “he wanted it big and sensational so that it makes an impact.” That was October of 2018.

Ulrich’s former roommate Raymond Zandstra says he made his views clear.

“He hated the doctor. He hated the clinic, he didn’t like Buffalo hospital,” Zandstra said.

Former neighbors say Ulrich had a visible sign in the window of his home against Allina and the doctor.

Later that month, reports show Ulrich showed up at the hospital in Buffalo, was yelling when he couldn’t get what he wanted and a nurse said she was fearful for her safety and the safety of others.

READ MORE: Mille Lacs Lake Ends 'Catch-And-Release Only' Walleye Fishing Season

The front desk pushed the panic alarm.

A month later, police arrested Ulrich for violating a restraining order against the doctor.

The police report shows he trespassed at the hospital. According to documents, he admitted he wasn’t supposed to be there but wanted to “straighten things out” because he was falsely accused.

Zandstra says the signs were there, but still grapples with how it resulted in such a horrific day.

“He was after him. So why would you shoot all these innocent people, because he couldn’t get his way? That’s the only thing I can figure out. Because he didn’t know those people. I know he didn’t,” Zandstra said.

Police reports also show dozens of police contacts with Ulrich from 2006 through 2020. They range from being drunk and possession of marijuana to being in a park after hours and trespassing.

Several reports reveal an alleged problem with a back surgery, back pain, Ulrich wanting medication or looking for a prescription.

Ulrich will be in court Thursday morning. He is expected to be formally charged ahead of that hearing.

MORE NEWS: Minnesota Weather: Drought Conditions Holding In Place As State Moves Into Fall

Gov. Tim Walz announced Wednesday that all flags at state and federal buildings will be flown at half-staff until sunset on Sunday in honor of the Buffalo victims.

Jennifer Mayerle