A German man who posted a manifesto calling for the "complete extermination" of many "races or cultures in our midst" shot and killed nine people in a Frankfurt suburb, authorities say.
The 43-year-old was later found dead at his home along with his mother, and authorities said they were treating the rampage as an act of domestic terrorism.
The gunman first attacked a hookah bar and a neighbouring cafe in Hanau about 10pm on Wednesday, killing several people, then travelled about 2.5km and opened fire again, first on a car and then a sports bar, claiming more victims.
Chancellor Angela Merkel said the shootings exposed the "poison" of racism in Germany and she pledged to stand up against those who seek to divide the country.
"There is much to indicate that the perpetrator acted out of far-right extremist, racist motives," she said.
"Out of hatred for people with other origins, other faiths or a different appearance."
People of Turkish background make up Germany's single largest minority and Turkey's ambassador said five of the people killed in the attack were Turkish citizens.
Germany's federal prosecutor Peter Frank said that all nine people killed were of foreign backgrounds and that six others were injured, one seriously.
Investigators said it appeared the gunman acted alone, but Frank said the "goal of the investigation is to find out whether there were, or are, people who knew of, or supported" the attacks.
Both the attacker and his 72-year-old mother had gunshot wounds, and the weapon was found on him, said Peter Beuth, interior minister for the state of Hesse.
Frank identified the gunman only as Tobias R, in line with German privacy laws, and confirmed he had posted extremist videos and a manifesto with "confused ideas and far-fetched conspiracy theories" on his website.
In the manifesto, the man claimed to have approached police several times with conspiracy theories but Beuth said it does not appear the gunman had a criminal record or was on the radar of Germany's domestic intelligence agency.
On the website, the man wrote that he was born in Hanau in 1977 and grew up in the city, later training with a bank and earning a business degree in 2007.
Australian Associated Press