Germany has some of the world's strictest gun laws. But that did not stop Saturday's Munich attacker - Ali David Sonboly, an 18-year-old dual Iranian-German national - from carrying out his shooting spree.
The assailant most likely obtained his pistol illegally and did not have a license, German police officials said. That development could have implications for a country that has already exhausted most legal means to prevent such shooting sprees.
"Germany has a good system of legal gun ownership, but illegal firearms pose a big problem," said Nils Duquet, a weapons expert in Belgium who works for the Flemish Peace Institute. According to Duquet, there are millions of illegal weapons in Europe.
Following two horrifying school shootings in 2002 and 2009, German MPs passed stricter gun legislation that made it harder to legally obtain weapons. Buyers younger than 25 must now pass a psychological exam before being able to acquire firearms in Germany. Shooting incidents significantly dropped as a consequence.
Theoretically, those measures might also have stopped Sonboly from being able to buy a gun legally. Officials believe the suspect could have been depressed, and a video shows the attacker saying he had gone through "inpatient treatment".
Most mass shootings in Europe that are not associated with international terror groups have been carried out with legally obtained weapons.
Duquet also emphasised that the attacker's use of a pistol was significant. "If you want to buy an illegal gun in Europe, what's important is having the right networks. For assault rifles, you need better criminal connections."
Among several other factors, the borderless Schengen Area and Europe's proximity to current or former war zones have facilitated illegal-weapons transports into the continent. An increasing number of terrorist attacks over the past two years were carried out with illegal pistols and semi-automatic rifles from Eastern Europe.
At least some of the weapons used in the January 2015 shootings in Paris were reportedly purchased legally in Slovakia, according to the Guardian and the Wall Street Journal. Metal pins were placed in the barrel to render the guns useless, allowing for their sale. But the pins were hammered out illegally after purchase.
Image 1 of 11: Police officers point their weapons outside the Olympia mall in Munich. Photo / AP
Young gunmen 'study other shooters'
The US psychologist who wrote a book about school shootings that investigators found in the Munich gunman's room says researching other mass killers can be a warning sign.
Peter Langman, author of two books about school shootings, said young gunmen often are looking for role models and juvenile killers "more frequently study other shooters".
Police in Munich said German-Iranian Ali David Sonboly, 18, had a German translation of Langman's 2010 book Why Kids Kill: Inside the Minds of School Shooters, with materials relating to a 2009 school shooting in Germany and the bomb-and-gun attacks in Norway by Anders Behring Breivik, who killed 77 people five years ago on Saturday. "Younger shooters in particular, meaning adolescents into their 20s, often research other shooters and find a role model. That is not something you see with the older shooters," Langman said.
The shooter was found dead of an apparent self-inflicted gunshot wound several hours after the attack on Saturday that left nine others dead, most of them teens. Police are investigating whether the killer was behind a hacked Facebook account that sought to lure other youths with free giveaways to a McDonald's that was targeted. They also said the shooter appeared to have been the victim of bullying and had been receiving psychological treatment.
Langman said there are often a lot of warning signs before a shooting attack, and that "it is never one thing; it is always a combination of multiple factors". In some cases "people simply announce what they are going to do ... Very often, there is a long trail of comments and behaviours. People don't usually wake up one day and become a mass murderer".