MINNEAPOLIS — A gunman opened fire at a health-care clinic in rural Minnesota on Tuesday morning, killing one person and wounding four others in what police believe was a targeted incident.

The shooting was reported shortly before 11 a.m. at the Allina Health Clinic in Buffalo, about 40 miles northwest of Minneapolis. State and federal law enforcement officials from throughout the region rushed to what the state Bureau of Criminal Apprehension described as a “shooting event with multiple victims.”

Officials said they arrested Gregory Paul Ulrich, 67, of Buffalo, who turned himself in at the scene. Authorities described Ulrich as someone who was known to local law enforcement and had a long history of “conflict” and run-ins with police dating to 2003. Though police said they did not know of a specific motive, they said Ulrich acted alone and they believe he targeted the clinic for personal reasons, not terrorism.

“This history we have as a department with this individual makes it most likely that this incident was targeted at the facility or at someone within that facility,” Buffalo Police Chief Pat Budke said at an afternoon news conference.

Budke said prior contacts with Ulrich suggested he had been unhappy with his health care. Budke declined to elaborate, citing the ongoing investigation.

Richard Ulrich said his brother Gregory had worked in construction and became addicted to opioids a few years ago after he had back surgery for an old injury he had suffered on the job.

“He started taking these opioid-type pain medications and he would call and tell me they should be giving him more; he said he was in pain,” said Richard Ulrich, a retired NASA engineer who lives in Florida.

“He would call, and he seemed to be upset with the doctors and frustrated that they wouldn’t give him any medication. That’s probably what set him off. That’s my guess.”

Richard Ulrich wasn’t sure if his brother was suffering physically or just addicted — and noted that his brother didn’t mention his addiction the last time they spoke, about two months ago. “I didn’t sense he was in a lot of pain. He just liked taking that stuff,” he said.

He said he had never known his brother to be violent. “I don’t think he was some sort of terrorist or anything; he just had an opioid problem. It just got to him, I guess,” Richard Ulrich said.

But Gregory Ulrich had reportedly been accused of threatening medical staff, including at the clinic in Buffalo. The Minneapolis Star Tribune, citing a 2018 police report, reported that Ulrich was harassing his former doctor and threatened an attack that was “big and sensational so that it makes an impact.”

According to the paper, Allina staff filed a restraining order against Ulrich barring him from the property — which he was accused of violating in November 2018. But the case was later dismissed by a judge, who said Ulrich was mentally unfit to stand trial, according to the Star Tribune.

An Allina Health spokesman declined to comment; prosecutors could not be reached.

According to an emergency audio dispatch of the incident, Ulrich was found face down with his hands up in the front lobby of the building, where he willingly surrendered to officers. He alerted them to at least four homemade explosive devices — including one in a suitcase placed near the clinic’s front desk — but it was not immediately clear if any exploded.

Budke and other law enforcement officials described a horrific scene with officers trying to tend to the critically wounded while being on guard amid threats of explosions.

An eyewitness named Tiffany told Fox 9 she had driven to the clinic to drop off her mother for a routine appointment when two nurses ran out of the building and jumped into her car. They told her someone was inside shooting.

“They said they heard about 11 shots within a minute. They were very scared and just wanted to get out of the place,” she said. “About two minutes later, we saw the front windows shot out … and we got out of there.”

Among law enforcement responding to the scene was the Minneapolis Police bomb squad, which arrived with what appeared to be a remote-controlled bomb-disposal robot. Officials said they were investigating potential devices at several locations, including at a Super 8 hotel about a mile from the clinic where they believed Ulrich was staying. Police had cordoned off the building and evacuated staff and guests.

Agents with the Bureau of Alcohol, Tobacco, Firearms and Explosives and the FBI also were at the scene. ATF agents were seen setting up a perimeter in a residential neighborhood near the Buffalo hospital, where some victims were initially taken before being flown to larger trauma centers in the Twin Cities.

One victim, who was flown to Hennepin County Medical Center in Minneapolis, later died, according to a hospital spokeswoman. Four other victims — including a woman who was said to have been shot three times, according to emergency audio dispatch — were flown to North Memorial Medical Center in Robbinsdale, a Level 1 trauma center. A hospital spokeswoman said Tuesday night three patients were in critical but stable condition while another had been released.

Minnesota court records show Ulrich has had several run-ins with the criminal justice system, mostly for traffic and alcohol-related offenses. In 2004, according to court records, Ulrich was convicted of driving while intoxicated. He was again charged with driving while intoxicated in 2005 and 2006. In 2008 he was charged with violating an open bottle law. In 2014, records show he was charged with possessing a small amount of marijuana.

Both Budke and Wright County Sheriff Sean Deringer implied there had been more recent run-ins with Ulrich but did not offer specifics.

Ulrich is expected to make a court appearance Thursday.

The shooting shocked the city of roughly 16,000 people — a rapidly growing community where some residents commute into the Twin Cities for work. Area schools were put on lockdown while some businesses, already limited in hours and capacity because of coronavirus safety measures, closed out of precaution.

Budke and other public officials were visibly shaken during the news conference, with Budke pausing several times to regain his composure while talking about what he described as a heartbreaking day “that no community ever wants to go through.”

“This doesn’t happen in Buffalo, Minn., right?” Mayor Teri Lachermeier said. But she urged residents to come together. “We’ve got to get through this,” she said.

Mark Berman and Julie Tate contributed to this report.