MUNICH • He was bullied at more than one school, played violent video games and developed a fascination with mass shootings.
He also kept a copy of the German edition of Why Kids Kill: Inside The Minds Of School Shooters, a study by an American academic psychologist, and he was treated for psychiatric problems.
Somewhere along the way, Ali Sonboly, 18, got his hands on a 9mm Glock handgun and hundreds of rounds of ammunition. And at 5.52pm last Friday, at a McDonald's outlet in Munich, a few kilometres from where he lived with his parents and brother, he started shooting.
By the time the rampage was over, he had killed eight young people and one middle-aged person. Then, in front of two police officers, he killed himself with his own gun, the police said.
It was the third mass attack in Europe in little over a week. But unlike those two attacks, the one in Munich appeared, based on initial evidence, to have no overt links to the Islamic State in Iraq and Syria or other terrorist groups, officials said on Saturday. Nor did it seem to be directly linked to the wave of migrants that has fuelled tensions.
Instead, according to accounts by the police, prosecutors, neighbours and schoolmates, the assault appeared to be less ideological and more personal: a sudden, violent outlet for a quietly troubled young man.
There were indications that Sonboly's rampage might not have been entirely without political overtones. It was carried out on the fifth anniversary of a massacre in Norway by Anders Behring Breivik, a right-wing extremist who killed 77 people. Asked about a possible link based on the date, Munich police chief Hubertus Andrae said "this connection is obvious" and was part of their investigation.
Bavarian police chief Robert Heimberger yesterday said Sonboly was planning his crime for a year.
He said material found at his home showed that the gunman was an avid player of violent video games. The authorities also found newspaper reports on police responses to other mass shootings, as well as the book on school gunmen.
"It bears noting that the perpetrator had an academic book at his home," said Dr Klaus Hurrelmann, a professor of public health and education at the Hertie School of Governance in Berlin. "He appears to have recognised a familiar suffering among the 10 men in the book, who were in a similar situation."
There will be questions about the degree to which other attacks, and violence in popular culture, might have influenced him. But the initial picture of Sonboly that emerged after police found him dead was of a young man whose concerns were much closer to home.
Born and raised in Munich, he held both German and Iranian citizenship. His parents immigrated to Germany, and his father drives a cab. A student at a nearby public school, he grew up in a secular household, neighbours said, and the family took pleasure in celebrations like birthdays.
"He was always friendly, very friendly," said Mr Tovaiau Edo, 32, who lives in his apartment building. "When I saw him and saw the story, it's like two different people."
But officials and neighbours on Saturday said Sonboly was struggling on several levels. He had two previous encounters with the police, once having been bullied by three other young people and once having been robbed. He was getting psychiatric treatment, possibly for depression, officials said.
"He was always nice, kind, helpful," said a 14-year-old neighbour who attended the same school as the attacker and asked to be identified only by her first name, Safete.
Safete said she saw Sonboly at their apartment building around midday last Friday, but "he didn't greet me, like he normally does".
He had earlier argued with a schoolmate, "and said he was going to go on a shooting rampage" but she said she could not remember the name of the schoolmate, or the date of the altercation.
Safete's cousin Majlinda, 15, who attends the same school, said the gunman had been bullied at his current school and a former one. "This has nothing to do with Islam," she said. "It's because he was bullied."
More questions will be raised over whether schools, social services and Sonboly's family failed to notice his problems. Mr Heimberger said his parents were in shock and unable to be interviewed.
But chief prosecutor Thomas Steinkraus-Koch yesterday said Sonboly did not specifically choose his victims. "It is not the case that he deliberately selected" the people who he shot, he said, nor did the victims include any of his classmates.
NEW YORK TIMES, REUTERS, AGENCE FRANCE-PRESSE