BUFFALO, Minn. (AP) — A report says the man charged with murder in a shooting at a Minnesota medical clinic bought the handgun used in the attack with a permit from local police, despite a restraining order for a threat against the clinic.

The Minneapolis Star Tribune report cites a law enforcement source it did not name. Gregory Ulrich is charged in an attack on an Allina Health clinic this week. Ulrich had threatened in 2018 to carry out a mass shooting there.

A criminal case against Ulrich was dismissed when he was found incompetent, which meant he should have been prohibited from gun ownership under state law. The Buffalo police chief declined to comment on the report.