German police believe the Munich shooter who killed 9 people in a terrorist attack on a shopping mall and a nearby McDonald's was an 18-year-old German-Iranian.
They say his motive was "unclear", and he may have been the sole shooter.
An initial examination of the gunman's body, found about 1 kilometre away from the shopping centre, showed he had died from a self-inflicted wound.
A red rucksack he was wearing was checked for explosives.
Authorities urged residents to remain inside and put the Bavarian capital on lockdown on Friday night.
Germany's elite GSG9 anti-terror unit and federal police were called in to help in the manhunt.
Witnesses reported seeing three men with firearms near the Olympia Einkaufszentrum mall, one of Munich's largest.
In addition to the dead, at least 16 people were wounded in the rampage.
Munich police spokesman Marcus Martins said earlier a ninth body had been found near the attack site and police were "intensively examining" whether it might be that of one of the suspects.
The city sent a smartphone alert declaring an "emergency situation" and telling people to stay indoors and German rail company Deutsche Bahn stopped train traffic to Munich's main station.
It was the third major act of violence against civilians in Western Europe in eight days. The previous attacks, in the French resort city of Nice and on a train in Bavaria, were claimed by the Islamic State group.
While police called the mall shooting an act of terrorism, they said they had "no indication" it involved Islamic extremism and at least one witness said he heard a shooter shout an anti-foreigner slur.
The attack started at a fast food restaurant shortly before 6pm local time, police said.
Video obtained by The Associated Press from German news agency NonstopNews showed two bodies with sheets draped over them not far from a McDonald's across from the mall. Another video posted online shows a gunman emerging from the door of the McDonald's, raising what appears to be a pistol with both hands, and aiming at people on the footpath, firing as they flee in terror.
Witness Luan Zequiri said he was in the mall when the shooting started on Friday.
He told German broadcaster N-TV that he heard the attacker yell an anti-foreigner slur and "there was a really loud scream".
He said he saw only one attacker, who was wearing jack boots and a backpack.
"I looked in his direction and he shot two people on the stairs," Zequiri said. He said he hid in a shop, then ran outside when the coast was clear and saw bodies of the dead and wounded on the ground.
Residents of Munich opened their doors to people seeking shelter using the Twitter hashtag '#opendoor'.
Also on Twitter, police asked people to refrain from speculating about the attack.
Germany's interior minister cut short his holiday in the US to go back to Berlin late on Friday to meet with security officials.
German Chancellor Angela Merkel's was being regularly briefed on the attack, said her chief of staff, Peter Altmaier.
"All that we know and can say right now is that it was a cruel and inhumane attack," he said on German public channel ARD.
"We can't rule out that there are terrorist links. We can't confirm them, but we are investigating along those lines too."
Altmaier noted that Friday was the fifth anniversary of the massacre in Oslo, Norway, by a far-right extremist that killed 77 people, 69 of them at a youth summer camp.
"You can only have absolute security in an absolute surveillance state, and nobody wants that, it would be the opposite of our free western European way of life," he said.
"But, and this became clear again today, we can't talk down this danger. It's a danger that many countries are exposed, especially in the west, and that's why it's important to give our security agencies the instruments they need."