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, who was born and raised locally, opened fire near a busy shopping mall on Friday, triggering a lockdown in the Bavarian capital in the third act of violence against civilians in Western Europe - and the second in southern Germany - in eight days.
Seven of his victims were themselves teenagers, police said, and Bavarian state crime office president Robert Heimberger said the gunman was carrying more than 300 bullets in his backpack and pistol when he was later found dead of a gunshot wound.
Following a police search of the attacker's room, where a book on teenage shooting sprees was discovered, Munich police chief Hubertus Andrae all but ruled out an Islamist militant link in the attack, in which a further 27 people were wounded - including some hurt when panic spread.
"Based on the searches, there are no indications whatsoever that there is a connection to Islamic State" or to the issue of refugees, he told a news conference.
Video posted on social media allegedly showed a man opening fire outside a McDonalds near the mall:
Bavarian State premier Horst Seehofer said the killings in Munich and an axe attack by a 17-year-old asylum-seeker that injured five people in Wuerzburg - also in Bavaria - on Monday 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.
He was speaking just over a week after the Bastille Day massacre by a truck driver in Nice. Both the Nice rampage, which killed 84, and the Wuerzburg attack were claimed by Islamic State.
Chancellor Angela Merkel was meeting with her top security advisors to review Friday's attack and would issue a statement Saturday afternoon, her office said.
The Munich gunman, whose body was found on a side street near the mall, was not identified but 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.
Police commandos, armed with night vision equipment and dogs, had raided an apartment in the Munich neighbourhood of Maxvorstadt early on Saturday where the German newspaper Bild said the gunman lived with his parents.