An 18-year-old man with dual German and Iranian citizenship opened fire at a McDonald's restaurant and a crowded shopping mall in Munich Friday, killing at least nine people and injuring 16 others before tuing his gun on himself, the city's police chief said.

Hubertus Andrae told reporters the gunman's motive was "fully unclear", and there was no immediate claim of responsbility by any terror group.

Authorities initially said they were searching for three attackers, but Andrae said two people who fled the scene in a car were determined not to be involved.

Of the injured victims, the police chief said three were in critical condition and 13 were still hospitalized. Andrae added that children and teenagers were among the victims.

The shooter's body was found in a side street more than half a mile from the Olympia Einkaufszentrum mall. Andrae said the gunman had been living in Munich "for a while", later clarifying that he had been a city resident for at least two years and was not previously known to law enforcement.

The attack led to a major police operation in Germany's third-largest city. Responding to witness reports of multiple gunmen, Germany's elite GSG9 anti-terror police, as well as federal police, were called in to help with the search. In all there were 2,300 officers involved, including SWAT from other German states and from neighboring Austria.

Munich's transit system was shut down for hours before it was reopened early Saturday. Local police asked people to avoid public places, a waing echoed by the U.S. Consulate, which advised American citizens to "shelter in place". Highways heading out of the city were closed and vehicle checkpoints were established.

With public transportation halted at the height of the Friday evening rush hour, Munich residents opened their homes to people seeking shelter using the Twitter hashtag (hash)opendoor.

The attack took place on the fifth aiversary of attacks in Norway by far-right extremist Anders Behring Breivik, who killed 77 people in a gun and bomb attack on a Labour party retreat, as well as the center of Oslo.

Andrae said the attack began at the McDonald's at 5:50 p.m. local time Friday. Video posted online showed the gunman emerging from the restaurant, raising what appeared to be a pistol with both hands and aiming at people on the sidewalk, firing as they fled in terror. Another video obtained by The Associated Press from German news agency NonstopNews showed two bodies with sheets draped over them not far from the restaurant.

Andrae said the attacker crossed the street to the shopping mall, where he fired more shots, then exchanged fire with plainclothes police officers as he attempted to flee the area. The chief said none of the responding officers were seriously injured.

Witness Luan Zequiri told German broadcaster NTV that he heard the attacker yell an anti-foreigner slur and "there was a really loud scream." He added that he saw only one gunman, who was wearing boots and a backpack.

"I looked in his direction and he shot two people on the stairs," Zequiri told the station. 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.

"Many shots were fired, I can't say how many but it's been a lot," an employee at the mall told NTV, according to Reuters. "All the people from outside came streaming into the store and I only saw one person on the ground who was so severely injured that he definitely didn't survive."

Germany's Interior Ministry said Munich police had set up a hotline for conceed citizens. On Twitter, police asked people to refrain from speculating on the attack. Germany's interior minister cut short his holiday in the United States to go back to Berlin late Friday to meet with security officials.

German Chancellor Angela Merkel 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 chael 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 said numerous attacks had been prevented in Germany in recent years, "but, and this is important, there can never be absolute security.

"You can only have absolute security in an absolute surveillance state, and nobody wants that, it would be the opposite of our free weste 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."

In Washington, the White House issued a statement condemning the attack on what it called "the heart of one of Europe's most vibrant cities."

"The resolve of Germany, the United States, and the broader inteational community will remain unshaken in the face of acts of despicable violence such as this," the statement concluded.

The mall is located in the northe part of Munich is not far from the city's Olympic Stadium in the Moosach district of the Bavarian capital. It is also not far from where Palestinian attackers opened fire in the Olympic Village in 1972, killing 11 Israeli athletes.

It's the second attack in Germany in less than a week and the third major act of violence against civilians in Weste Europe in eight days. On July 14, a French-Tunisian man killed 84 people and injured more than 200 others when he drove a truck into a Bastille Day fireworks crowd in Nice, France.

On Monday, a 17-year-old Afghan wounded four people in an ax-and-knife attack on a regional train near the Bavarian city of Wuerzburg, and another woman outside as he fled. All survived, although one man from the train remains in life-threatening condition. The attacker was shot and killed by police.

The Islamic State group claimed responsibility for both attacks, but authorities have said the Afghan teen likely acted alone.

Fox News' Kitty Logan, FoxNews.com's Benjamin Weinthal and The Associated Press contributed to this report.