ST. LOUIS (AP) — St. Louis police have confirmed that the gunman who forced his way into a high school, killing a student and a teacher and leaving seven others wounded, used an assault rifle that had been taken away from him earlier this month.

A police statement Wednesday night said the mother of Orlando Harris, 19, called police on the evening of Oct. 15 after she found a gun and she wanted it removed. The statement said officers responded but “determined at that time the suspect was lawfully permitted to posses the firearm.”

The statement said someone known to the family was contacted and took possession of it.

Somehow, Harris got the gun back. How that happened is under investigation.

Story continues below:

The weapon described by police as an AR-15-style rifle was used in the attack Monday at Central Visual and Performing Arts High School. Police responded within minutes and confronted and killed the gunman, who graduated from the school last year. He had around 600 rounds of ammunition with him.

Tenth-grader Alexzandria Bell and teacher Jean Kuczka were killed in the attack, and seven 15- and 16-year-olds were wounded. None of the injuries are believed to be life-threatening.

“While it is not yet clear when or how the suspect came to be in possession of the firearm after this incident, we can confirm that the firearm involved in this incident is the firearm used in the shooting Monday,” the police statement read.

Earlier Wednesday, Police Commissioner Michael Sack had said the confiscated gun was “believed to be” the same one used in the shooting.

Police believe Harris had intended targets. They have not said if any of the victims were among them.

Harris’ mother was “heartbroken” by the shooting, Sack said. She and other relatives had long dealt with Harris’ mental health issues and even had him committed at times, Sack said at a news conference. They also monitored his mail and often checked his room to make sure he did not have a weapon.

Harris, in a note left behind, lamented that he had no friends, no family, no girlfriend and a life of isolation. His note called it the “perfect storm for a mass shooter.”

“Mental health is a difficult thing,” Sack said. “It’s hard to tell when somebody is going to be violent and act out, or if they’re just struggling, they’re depressed, and they might self-harm.”

Central Visual and Performing Arts shares a building with another magnet school, Collegiate School of Medicine and Bioscience, which also evacuated as the shooting unfolded. Central has 383 students, Collegiate 336.

The building was locked Monday morning and an unarmed security guard saw Harris trying to get in. Sack has declined to say how Harris forced his way inside.

Officers, some of whom were off-duty, arrived four minutes after the 911 call. Amid the chaos of kids, teachers and staff fleeing, officers asked some of them where the gunman was. Eight minutes after arriving, officers located Harris on the third floor, barricaded in a classroom. Police said that when Harris shot at officers, they shot back and broke through the door.

The St. Louis shooting was the first school shooting to involve multiple deaths since a gunman killed 19 children and two teachers at Robb Elementary School in Uvalde, Texas, in May, according to a list of shootings compiled by Education Week.