The 18-year-old gunman suspected of killing nine people in a mass shooting in Munich on Friday spent more than a year planning the attack and was able to buy a handgun on the dark web, investigators have said. Bavarian investigator Robert Heimberger said Ali Sonboly had visited the scene of a previous school shooting in the German town of Winneden and took photographs, adding further evidence to the claim by Munich’s police chief, Hubertus Andrae, that the teenager was “obsessed with shooting rampages”. Heimberger also said the gunman likely purchased his illegal weapon online, through a website trafficking illegal weapons hosted on the dark web. Germany has some of the world’s strictest gun laws, but illegal weapons remain a threat Thomas Steinkraus-Koch, spokesman for Munich prosecutor’s office, said there was still no evidence of any political motivation to the crime, nor that the shooter killed specific victims. A police spokesman also confirmed that the suspect spent two months having inpatient psychiatric treatment last year. One question facing authorities investigating Friday’s attack is whether Sonboly, who was bullied and isolated at school, intentionally set out to kill other young people. Seven of his victims were teenagers, five of them under 16. The other two were a 20-year-old man and a 45-year-old woman. Why kids kill: young shooters tend to research murderous role models However, police have confirmed there is no evidence Sonboly targeted specific victims in the attack. The teenager apparently tried to lure his victims to a McDonald’s restaurant, the initial site of the shooting, with a bizarre message on a hacked Facebook page, promising free meals to anyone at the venue at 4pm. Police believe this was a venue Sonboly knew and they initially thought he may have recognised his victims, although he did not begin shooting until two hours after the Facebook invitation. Sonboly had spent time researching previous mass shootings, including one in Winneden, a site he visited and photographed. In 2009, Tim Kretschmer, 17, killed 15 people at his former school before fleeing and killing himself.