Europe reacted in shock to the third attack on the continent in just over a week, after the black-clad gunman went on a shooting spree at a shopping centre on Friday evening before turning the gun on himself.
“There is absolutely no link to the Islamic State,” Munich police chief Hubertus Andrae said.
He said the assault was a “classic act by a deranged person” and described an individual “obsessed” with mass shootings.
He said German investigators saw an “obvious link” between Friday's killings and Breivik's massacre of 77 people in a bomb attack in Oslo and a shooting rampage on the nearby island of Utoya exactly five years earlier.
Most of the victims in Friday's attack were foreigners.
Munich prosecutor Thomas Steinkraus-Koch said the 18-year-old German-Iranian student – named as David Ali Sonboly – had suffered depression, while media reports said he had undergone psychiatric treatment.
The teenager had 300 rounds in a rucksack when he targeted the busy Olympia shopping mall, just minutes away from the flat he shared with his family, according to authorities.
Tributes for victims
Grieving Munich residents laid roses and lit candles in memory of the victims, with one placard bearing the simple plea: “Why?”
“Bloodbath in Munich,” was the headline on the best-selling Bild newspaper as Germany struggled to come to terms with the killings.
Among the nine killed were three Turks, three Kosovans and a Greek national, according to their foreign ministries.
Most of the casualties were young people aged 15 to 21, with three women among the dead according to Munich police.
Sixteen people were wounded, three of them critically.
Chancellor Angela Merkel was to convene her security council on Saturday.
The attack sent Germany's third largest city into lockdown as police launched a massive operation to track down what had initially been thought to be up to three assailants.
An amateur video posted on social media appeared to show a man in black walking away from a McDonald's fast foot outlet in Munich while firing repeatedly with a handgun as people fled screaming.
A police patrol shot and wounded him but he managed to escape before police found the body of what they believed was the “only shooter.”
'Never heard of problems'
Sonboly is thought to be have been born in Germany to an Iranian father who worked as a taxi driver and a mother who worked at a department store.
Neighbour Delfye Dalbi, 40, described him as “a good person” who “helped, would share the newspapers”.
“Not once did I see him angry. I never heard of him having problems with the police or other neighbours,” she said.
Survivors described terrifying scenes as shoppers rushed from the area, some carrying children in their arms.
“We entered McDonald's to eat… then there was panic, and people ran out,” one woman told Bavarian television.
Another video appeared to show the gunman on a car park roof in a heated exchange with a man on a nearby balcony.
“I'm German, I was born here,” the assailant replied after the man fired off a volley of swear words, including an insulting term for foreigners.
Munich's main train station was evacuated and metro and bus transport suspended for several hours while residents were ordered to stay inside, leaving the streets largely deserted.
'Europe stands united'
President Joachim Gauck said he was horrified by the “murderous attack”, while US President Barack Obama voiced staunch support for Washington's close ally.
“Our thoughts are with the victims, their families, and all German people.
Europe stands united,” EU foreign policy chief Federica Mogherini said.
Europe has been on high alert for terrorism after a string of attacks in neighbouring France and Belgium claimed by IS.
The attack came just four days after a 17-year-old asylum seeker went on a rampage with an axe and a knife on a train near Wuerzburg, also in Bavaria.