MUNICH (HuffPost/Reuters) - A German-Iranian teenager who killed nine people and then himself in Munich had undergone psychiatric treatment and was in all probability a lone gunman who had no Islamist militant ties, police said on Saturday.

The 18-year-old attacker opened fire at a fast food restaurant near a busy shopping mall in Munich on Friday evening, killing at least nine people in the third attack on civilians in Western Europe in eight days. He was later found dead of a suspected self-inflicted gunshot wound, carrying more than 300 bullets in his backpack.

As authorities sought to piece together the circumstances of an attack, they all but ruled out any link to Islamic militant groups.

Following a police search of the shooter’s room, Munich police chief Hubertus Andrae said there are “no indications whatsoever that there is a connection to Islamic State,” nor is shooting connected to the issue of refugees. The investigations also indicate the shooter acted alone, he said.

The teenage gunman was born and brought up in the Munich area and was a dual Iranian-German national, police said.

He had spent time in psychiatric care, and appeared to be obsessed with mass shootings ― his room was full of books on the subject, including a title called: ‘Rampage in Head: Why Students Kill.’ Police said he had no criminal record but he was a victim of two minor crimes ― a theft in 2010 and bodily harm in 2012.

German Interior Minister Thomas de Maiziere said there were indications the killer had been bullied “by others his age.” He also cited concerns about the role violent video games may have played in the crime.

Police Raid

The shooting took place on the fifth anniversary of twin attacks by Norwegian mass murderer Anders Breivik, who in 2011 shot dead 69 attendees at a youth summer camp hours after murdering eight others by detonating a van bomb in Oslo. De Maiziere said it was also too early to associate the Munich shootings with Breivik.

In addition to determining the motive, police will have to find out how the 18-year-old got the firearm used in the attack in a country whose gun control system is described by the U.S. Congress Library as being “among the most stringent in Europe.”

Police commandos, armed with night vision equipment and dogs, raided an apartment in the Munich neighborhood of Maxvorstadt early on Saturday where the German newspaper Bild said the gunman lived with his parents.

“I am shocked, what happened to the boy? Only God knows what happened,” Telfije Dalpi, a 40-year-old Macedonian neighbor of the family told Reuters. “I have no idea what happened - but he was a good human being. I have no idea if he did anything bad elsewhere.”

There was a huge police presence in the street, which lies just north of Munich’s old city.

Reuters TV / ReutersA screen grab taken from video footage shows people being evacuated onto a bus following a shooting rampage at the Olympia shopping mall in Munich, Germany July 22, 2016.

‘Incomprehensible Bloodbath’

Andrae said authorities saw no links to an attack in southern Germany last Monday in which an axe-wielding 17-year-old asylum-seeker injured five people in an incident claimed by the Islamic State group.

Bavarian State premier Horst Seehofer said attacks should not be allowed to undermine democratic freedoms. “For the second time in a few days we’ve been shaken by an incomprehensible bloodbath... Uncertainty and fear must not be allowed to gain the upper hand,” a visibly shaken Seehofer told reporters.

Andrae said it was premature to say whether Friday’s shooting was a terrorist attack, as French President Francois Hollande said, or the work of a deranged person.

Police said they were investigating a video in which the gunman is heard shouting “I am German” and exchanging racial slurs and profanities with another man. “We are trying to determine who said what,” a police spokesman said.

Chancellor Angela Merkel met with her top security advisors Saturday to review Friday’s attack. “We are all - and I’m saying this on behalf of the whole federal government - mourning with a heavy heart for those who will never return to their families,” Merkel said.

“To the families, the parents and children for whom everything today seems empty and pointless, I say personally and in the name of many, many people in Germany: we share your pain, we’re thinking of you and we’re suffering with you.”

Victims

Seven of his victims were themselves teenagers. Three of his victims were 14 years old, two were 15, one was 17 and one 19. The others were 20 and 45, the police chief said.

At least 16 people, including several children, were in hospital and three were in critical condition, Andrae said.

Kosovan media reported that three of the victims were of Kosovan origin. Naim Zabergja, the father of one of the victims wrote on Facebook: “With great sadness I want to inform you that my son Dijamant Zabergja, 21, was killed yesterday in Munich.”

A second victim was named by her brother on Facebook as Armela Segashi, who he said died along with a third, Sabina Sulaj.

Friday’s incident snarled traffic as authorities blocked highways, closed the main railway station, and shut down public transport.

Thousands of people had been crowding the streets and squares in Munich’s city center on Friday for a beer festival.

“There were a few people who came running towards us who were screaming and in panic. But mostly it was surprisingly calm,” said Elena Hakes, who had been with a friend in the Odeonsplatz square.

The incidents in Germany follow an attack in Nice, France, in which a Tunisian drove a truck into crowds celebrating Bastille Day, killing 84. Islamic State claimed responsibility.