At least nine people were shot dead and 16 wounded at a Munich shopping mall on Friday by a German-Iranian teenager who later committed suicide, investigators say.
The gunman had no links with the Islamic State (IS) jihadist group, suffered depression and had an obsession with shooting sprees like the massacre five years ago by Norwegian rightwing fanatic Anders Behring Breivik. Here is what we know about the attack and the background against which it took place:
The shooting began at a McDonald's fast-food restaurant at the Olympia shopping mall near Munich's Olympic stadium shortly before 1600 GMT on Friday.
A video posted on social media appeared to show a man dressed in black walking away from the restaurant while firing repeatedly on people as they fled.
At least nine people were killed and 16 injured, of whom three are in critical condition, Munich police said.
Kosovo said three of its citizens were among the fatalities, while Ankara said three Turks had died. It was not immediately clear if they had dual nationality.
Most of the casualties are young people aged 15 to 21, Bavarian public television said.
Initially believing three gunmen were involved, the authorities launched a city-wide manhunt, mobilising more than 2,000 police supported by the elite GSG-9 anti-terrorist unit and helicopters.
Munich's main train station was closed and public transport suspended for several hours. Investigators later found the body of the suspected shooter, who appears to have acted alone and then killed himself with a shot to the head.
Who was the gunman?
Munich police chief Hubertus Andrae said the suspect was an 18-year-old dual-citizen German-Iranian from Munich. His name has not been made public. Investigations of his home and police files point to "a classic act by a deranged person," Andrae said.
"There is absolutely no link to the Islamic State," he said, adding that the suspect had been obsessed with books and articles about mass killings "linked to maniacs".
He said German investigators have established an "obvious link" between Friday's shooting at a Munich mall and Breivik's mass killings on July 22, 2011.
The city's chief prosecutor also said the suspect had suffered "some form of depression", but voiced caution over reports he may have undergone psychiatric treatment.
Wave of attacks
The rampage is the latest in a string of jihadist attacks in western Europe but also on the fifth anniversary of the Breivik massacre that left 77 people dead.
Four days earlier, a 17-year-old asylum-seeker, believed to be a "lone wolf" Afghan or Pakistani inspired by the IS, went on a rampage with an axe and a knife on a regional train in Bavaria, injuring five people, two of them critically.
On July 14, Tunisian Mohamed Lahouaiej Bouhlel rammed a lorry into crowds enjoying a firework display on the seafront promenade in the French Riviera city of Nice, killing 84 people including children.
It was the third major attack on French soil in the past 18 months. The IS group also claimed suicide bomb attacks at Brussels airport and a city metro station in March that killed 32 people.
The focus on the suspected shooter's motives and background takes place in the context of a fierce debate about Germany's asylum policy and integration of its immigrants.
Bavaria, in particular, became the main gateway for hundreds of thousands of migrants and asylum-seekers who have arrived in the last couple of years. Hate crimes and attacks against migrants exploded after arrivals, mostly from the Middle East and Africa, reached record levels in 2015.
Some 923 offences against refugee shelters were reported in 2015 including 177 acts of violence, a sharp rise from the previous year, according to figures from the interior ministry.