A lone 18-year-old German-Iranian attacker who shot dead 10 people, including himself, in Munich was inspired by other mass shootings around the world with police on Saturday ruling out any link to the Islamic State extremist group.
Munich police chief Hubertus Andrae said the gunman, a student named in the German media as Ali David Sonboly, acted alone when he opened fire in a McDonald's restaurant and a nearby shopping centre on Friday. Prosecutors say he suffered from depression.
Andrae said the assailant had no connection to Islamic State, which has claimed recent attacks in the French city of Nice, in which 84 people died, and a knife-and-axe attack on a train in Germany in which four people and a passer-by were injured.
Instead, investigators found material on mass shootings in the gunman's room when they raided his family's Munich apartment early Saturday after Friday night's shooting spree in which 27 people were also injured.
Andrae told a press conference that he believed the far-right terrorist Anders Behring Breivik, whose rampage in Norway five years ago left 77 people dead, would have played a role in helping to drive the Munich shooter to launch his attack.
"It is obvious that it did," Andrae said, noting the material in the gunman's room, which included a book entitled, Rampage in My Head - Why Students Kill.
Security officials said the material showed the gunman had also been fascinated with the actions of a 17-year-old German who had shot dead 15 of his classmates seven years ago in the western German town of Winnenden, and that he may had felt bullied.
The Munich attack coincided with events in Norway marking the day five years ago when Breivik began his rampage by detonating a homemade bomb in Oslo following a deadly shooting spree on the nearby island of Utoya.
In her first public comments since the shooting, Chancellor Angela Merkel said Saturday that Germans are mourning those who died and "share the pain" of the victims' families and friends.
Merkel, who was speaking after a special meeting of the security cabinet, praised the police force not just for its professionalism but also for helping and protecting citizens. She spoke of the many gestures of kindness of Munich residents, praising their solidarity in such difficult times.
Police chief Andrae said all the fatalities were from Munich and the surrounding area. Two 15-year-olds and three 14-year-olds were killed, according to investigators. Other victims were aged 17, 19, 20 and 45 years.
Three women were among the nine killed. Three Turkish citizens were among the dead, Foreign Minister Mevlut Cavusoglu was quoted as saying by Turkey's state-run Anadolu news agency.
German Interior Minister Thomas de Maiziere said on Saturday the authorities had no information about the attacker prior to Friday.
De Maiziere visited the site of the attack later Saturday with his Bavarian counterpart, Joachim Herrmann, and appealed to people in Germany and Europe to remain calm.
The federal interior minister said he understood the unrest in the population after recent terrorist attacks in France and Germany, but urged caution in understanding each individual case and its background to draw the correct conclusions.
Police said that the attacker, who was born and grew up in Germany, was carrying 300 rounds of ammunition in a rucksack and had a 9mm caliber gun.
The gun was likely to have been obtained illegally and police were trying to establish how he got it.
Police say they are still trying to verify a series of mobile phone videos of the shooting, which have been screened by German media and which show the panic in the shopping centre when the gunman opened fire.
Another video filmed by a nearby resident apparently showed the person believed to be the gunman declaring: "I am a German. I was born in Germany.
"I was hospitalized for psychological problems," he is heard saying.
Police believe he may have also tried to lure his victims to the McDonald's where he launched his shooting spree with a fake Facebook post offering free meals.
Munich was returning to normal on Saturday after authorities placed the Bavarian capital on high alert, temporarily shutting down the city's mass public transport services, evacuating the main railway station and calling on people to remain in their homes.
Munich state prosecutor Thomas Steinkraus-Koch said that his office was treating the attack as a classic case of someone running amok, with the shooter having "no political motivation".
Police also say there was no evidence that he was influenced by the axe-and-knife attack by a 17-year-old Afghan refugee on passengers on a regional train and a passer-by near the Bavarian town of Wuerzberg.
Steinkraus-Koch also believes the attacker was suffering from psychiatric problems, saying investigators have so far not establish details of his mental state but could have had a depressive illness.
"We have indications that the offender could have been suffering from a significant mental disorder," Herrmann told a press conference.
Police also ruled out the shootings having any link with refugees living in Germany.