Europe reacted in shock to the third attack on the continent in just over a week, after 18-year-old David Ali Sonboly went on a shooting spree at a shopping centre on Friday evening before turning the gun on himself.
Officials said Sonboly, a German-Iranian student, had a history of mental illness.
"There is absolutely no link to the Islamic State," Munich police chief Hubertus Andrae said, describing the assault as a "classic act by a deranged person".
Investigators see an "obvious link" between Friday's killings and Breivik's massacre of 77 people in Norway exactly five years earlier, Andrae added.
Chancellor Angela Merkel, in her first reaction to the carnage, said Munich had suffered a "night of horror".
Most of the victims in Friday's attack were foreigners, including three Turkish nationals, three people from Kosovo and a Greek man.
Three Turks among Munich shooting dead
Most of the casualties were young people aged 15 to 21, with three women among the dead according to Munich police.
Prosecutor Thomas Steinkraus-Koch said Sonboly had suffered depression, while media reports said he had undergone psychiatric treatment.
The teenager had 300 rounds of ammunition 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.
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.
Sixteen people were wounded in the attack, three of them critically.
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 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".
Neighbours said Sonboly was born to Iranian parents, a taxi driver father and a mother who worked at a department store.
They lived in the well-heeled Maxvorstadt neighbourhood in a tidy social housing block popular with immigrant families.
Neighbour Delfye Dalbi, 40, described him as a helpful young man who was "never bitter or angry", though others remembered a quiet loner.
"All his body language said 'I don't want to talk to you,'" said Stephan, a waiter at the cafe on the ground floor of Sonboly's housing block.
A police source cited by DPA news agency said Sonboly loved playing violent video games and was an admirer of the 17-year-old German who shot dead 15 people at his school near Stuttgart in 2009.
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.
US President Barack Obama voiced staunch support for Washington's close ally Germany, while EU foreign policy chief Federica Mogherini said: "Europe stands united."
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 in Bavaria, injuring five people.
Interior Minister Thomas de Maiziere had said that assailant was believed to be a "lone wolf" who appeared to have been "inspired" by IS but was not a member of the jihadist network.
On July 14, a Tunisian used a truck to mow down 84 people after a Bastille Day fireworks display in Nice, the third major attack on French soil in the past 18 months.
Friday's massacre spurred many in Munich to think the unthinkable.
"It has reached us. People in Munich have long had a queasy feeling. Fears grew with every attack in Paris, Istanbul or Brussels," said the Abendzeitung newspaper's editor-in-chief Michael Schilling.
"Since Friday it is clear that there can be no security anywhere, not even in the safest German city."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ