A gunman who opened fire in a crowded shopping mall, killing three people, acted alone and apparently chose his victims at random, Danish police said Monday, effectively ruling out the attack being a “act of terrorism.”

The motive for Sunday’s attack inside one of Scandinavia’s largest shopping malls has yet to be determined by police. A suspect was quickly apprehended while carrying a rifle and a knife, and Copenhagen chief police inspector Sren Thomassen said the 22-year-old Danish man also had access to another gun.

He stated that the firearms were obtained illegally and that the suspect was known to mental health services, but he provided no further information.

“It was the worst nightmare possible,” Danish Prime Minister Mette Frederiksen said Monday, describing the attack as “unusually brutal.”

According to Thomassen, the three victims were a 17-year-old boy and a 17-year-old girl from Denmark, as well as a 47-year-old Russian man. Four more people were taken to the hospital with gunshot wounds and were listed in critical but stable condition. In total, 30 people were injured, the majority in a panicked stampede after the shots rang out at the Field’s shopping center on the outskirts of Copenhagen.

The most recent large-scale shooting occurred in February 2015, when a 22-year-old man was killed in a shootout with police following an attack in the capital that left two people dead and five police officers injured.

According to Danish media, the suspect arrived for a hearing in a packed courtroom, where he is expected to be arraigned on three preliminary charges of murder and four of attempted murder. Preliminary charges are a step before formal charges are filed, but they allow authorities to keep a suspect in custody during an investigation. According to media reports, he cannot be named due to a court order.

According to Thomassen, police have no evidence that anyone assisted the gunman, and his motive remains unknown.

“There is nothing in our investigation, or the documents we have reviewed, or the things we have found, or the witnesses’ statements we have gotten, that can substantiate that this is an act of terrorism,” Thomassen said, referring to the suspect as a “ethnic Dane,” a term used to describe someone who is white.

A grainy photo of the alleged gunman, a man wearing knee-length shorts, a vest or sleeveless shirt, and holding what appeared to be a rifle in his right hand, was released by Danish broadcaster TV2.

“He appeared to be very violent and angry,” said eyewitness Mahdi Al-Wazni to TV2. “As I was filming him, he spoke to me and said it (the rifle) isn’t real.” He appeared to be very proud of what he was doing.”

Images from the scene showed people fleeing the mall, where flowers had been laid on Monday.

Chassandra Stoltz, an 18-year-old student on her way to a nearby Harry Styles concert on Sunday night, described a stampede as the shots rang out. At first, she and her sister and father assumed it was because someone had spotted Styles, but she soon realized it was because of the panic, which included a man who grabbed his child from a stroller in the midst of the chaos.

“People were directing us to the exit sign, and we ran up the roof and got stuck there for a while, and then people started panicking all over the place and crying,” Stoltz explained.

The shooting forced the cancellation of Styles’ concert.

The attack on Sunday came about a week after a shooting in neighboring Norway, where police said a Norwegian man of Iranian origin opened fire during an LGBTQ festival, killing two people and injuring more than 20 others.