People leave the Olympia mall in Munich after several people were killed in a shooting.(Sebastian Widmann / Associated Press)
Police arrest three men, whose identities and roles were not yet confirmed, near Marienplatz square following a rampage shooting in Munich, Germany.(Johannes Simon / Getty Images)
Police officers escort people with their hands raised from inside the shopping center as they respond to a shooting at the Olympia Einkaufzentrum in Munich, Germany.(Joerg Koch / Getty Images)
Police officers secure the area around the Olympia Einkaufzentrum in Munich, Germany.(Joerg Koch / Getty Images)
People evacuate from the shopping mall with their hands up in Munich, Germany, after the shooting.(AFP/Getty Images)
Police officers stand guard as other officers escort people out after a shooting at the Olympia Einkaufzentrum in Munich, Germany.(Joerg Koch / Getty Images)
People evacuate with hands up after a shooting in a shopping mall in Munich.(AFP/Getty Images)
A body is covered with a sheet outside a mall, in Munich, Germany. A manhunt was underway Friday for a shooter or shooters who opened fire at a shopping mall in Munich, killing and wounding several people.(AP)
Policemen at Stachus hotel after a shooting in Munich, Germany.(Andreas Gebert / European Pressphoto Agency)
People run from the Olympia Einkaufszentrum mall after a shooting in Munich, Germany.(Associated Press)
An ambulance at the scene of a shooting at a Munich, Germany, shopping mall.(Matthias Balk / AFP/Getty Images)
Police officer search a nearby residential area after a shooting in Munich, Germany.(Matthias Balk / DPA)
German police officers respond to a shooting at the Olympia Einkaufzentrum in Munich.(Joerg Koch / Getty Images)
Police secure the area in the underground station Karlsplatz in Munich after a shooting in a shopping mall.(Andreas Gebert / EPA)
Police secure the area inside a shopping center in Munich, Germany, following a shooting.( AFP / Getty Images)
Police officers respond to a shooting at the Olympia Einkaufzentrum in Munich, Germany.(Joerg Koch / Getty Images)
Police officers rush to the shooting scene at a shopping center in Munich on Friday.(Matthias Balk / EPA)
Police officers secure the entrance to a subway station near a shopping mall where a shooting took place in Munich, Germany, on Friday.(Lukas Schulze / AFP / Getty Images)
Police cars and fire trucks stage near a shopping center after a shooting in Munich on Friday.(Matthias Balk / Associated Press)
Special police forces rush to the scene of a shooting at a shopping center in Munich, Germany.(Matthias Balk / EPA)
A gunman opened fire at a busy shopping mall in Munich on Friday evening, killing nine people and injuring 20 others in what police were investigating as a possible act of terrorism.
Police sealed off parts of the city, Germany’s third-largest, for hours and pleaded with its 1.4 million residents to remain indoors as they attempted to determine who was responsible for the attack.
The transit system was shut down, sirens wailed and helicopters clattered overhead as local authorities declared a state of emergency.
Witnesses reported seeing as many as three shooters in and around the Olympia shopping center. But police said they had found the body of the assailant about half a mile away, and he appeared to have acted alone.
The Munich police chief, Hubertus Andrae, told reporters that the suspect was an 18-year-old German-Iranian living in the city. He said the suspect was not previously known to the authorities and had no known links to terrorist groups.
“The motive or explanation for this crime is completely unclear,” he said.
Early Saturday, police issued a cautious all-clear.
It was the latest in a series of incidents of mass violence in Europe, and the second in Germany this week.
The attack in Munich started shortly before 6 p.m. Friday at a McDonald’s restaurant across from the mall , police and witnesses said.
A witness told CNN that her young son saw a man loading a gun in a restroom inside the fast-food outlet before he started shooting at diners.
“He was killing the children,” said the woman, who was not identified. There was blood everywhere, she said.
Another woman described the chaos inside the restaurant.
“We’d just sat down and started eating,” she told Germany’s Bayerische Rundfunk TV. “The workers bolted out; the children started crying and ran around in panic.”
The gunman then ran into the street, witnesses said.
A video shared on social media appeared to show a man dressed in black shooting at people outside the restaurant with a handgun. Another video showed a gunman firing from the roof of a nearby parking structure. There were also reports of shooting inside the mall.
At least 10 people were killed, including the gunman, police said.
In the initial confusion, there were reports of shootings at other locations in the city, but police said they appeared to be false alarms.
Residents described a ghostly silence in the normally bustling city center on Friday night, a time when pubs and restaurants are usually filled with people ringing in the start of the weekend.
In Washington, President Obama said the U.S. was ready to offer any assistance needed to investigate the attack.
“Germany is one of our closest allies,” he told reporters.
The incident was sure to provide fresh ammunition for Republican presidential nominee Donald Trump’s claims that the world is facing a substantially greater risk of terrorism demanding an aggressive response.
Hillary Clinton, the presumptive Democratic nominee, said in a tweet: “We stand with our friends in Germany as they work to bring those responsible to justice.”
There was no immediate claim of responsibility, and though authorities said they were investigating it as a terrorist attack, analysts pointed out that the bloodshed could have been an act of domestic violence inspired by anti-immigrant sentiment.
The government of Chancellor Angela Merkel has faced a strong backlash for offering asylum to hundreds of thousands of refugees in Germany, many of them from war-torn Syria.
The latest wave of Islamist violence across Europe has provided ammunition to those who claim it is impossible to safely assimilate so many newcomers.
On Monday, a 17-year-old Afghan man attacked passengers on a train with an ax and a knife near the German city of Wuerzburg before being shot and killed by police. No one died in that attack, though one passenger remains in critical condition.
The extremist group Islamic State group claimed responsibility, releasing a video in which the purported assailant describes himself as “a soldier of the caliphate.” But authorities have said the teen likely acted alone.
On July 14, 84 people were killed and more than 300 others injured when a 19-ton cargo truck was driven into a crowd along the waterfront in the southern France resort town of Nice.
Islamic State said one of its “soldiers” also carried out that attack. The driver, Mohamed Lahouaiej Bouhlel, was killed by police at the scene.
Merkel’s chief of staff, Peter Altmaier, said authorities weren’t ruling out any possible motives for Friday’s attack.
“There’s no clarity so far. I’d urge us all to wait for the investigation,” Altmaier told the German public broadcaster, ARD. “It was a despicable attack.”
In the video showing a gunman on the roof of the parking garage, the assailant can be heard saying in flawless German: “I’m a German, just like you.”
“You’re a jerk,” a voice is heard shouting at the gunman.
“I"m fed up with it all,” the gunman replies.
That led terrorism analyst Georg Mascolo to suggest that the attack may have been the work of a right-wing extremist. The shootings occurred on the fourth anniversary of the attack in Norway by Anders Behring Brevik that killed 77 people.
Brevik distributed a series of texts titled “2083: A European Declaration of Independence,” which among other things expressed opposition to Islam.
The mall is located near Munich’s Olympic Stadium, in the city’s northern Moosach district. The Olympic village was the scene of a terrorist attack during the 1972 games, when the Palestinian militant group Black September took 11 Israeli athletes hostage and eventually killed them.
Kirschbaum is a special correspondent who reported from Berlin. Zavis, a Times staff writer, reported from Los Angeles.
6:20 p.m.: The article was updated with police releasing additional details about the gunman.
4:45 p.m.: The article was updated with police saying the lone attacker appeared to have killed himself.
4:30 p.m.: The article was updated with additional details of the attack and with comments from President Obama and presumptive Democratic presidential nominee Hillary Clinton.
2:50 p.m.: The article was updated throughout with staff reporting.
1:45 p.m.: This article has been updated with news of an increase in the death toll to eight and the discovery of another body that could be one of the attackers.
1:30 p.m.: This article has been updated with news about the anti-terror police arriving.
12:30 p.m.: This article has been updated with new details throughout.
12:10 p.m.: This article has been updated with news that police are calling the attack “suspected terrorism.”
11:55 a.m.: This article has been updated with new details.
11:25 a.m.: This article has been updated with reports that six people were killed.
11 a.m.: This article has been updated with more information throughout.
10:45 a.m.: This article has been updated with news that police are looking for the shooter or shooters.
10:30 a.m.: This article has been updated with police urging people to avoid public places.
10:20 a.m.: This article has been updated with reports of deaths expected.
10 a.m.: This article was updated with reports that multiple people are injured.
This article was originally published at 9:45 a.m.