A gunman shot dead nine people “of migrant background” at two shisha bars Hanau, Germany, on February 19.
The suspect and his mother were later found dead in his flat.
Germany’s federal prosecutor Peter Frank said material the suspect Tobias R had posted online showed a “deeply racist mindset”.
Tobias R, 43, had also been influenced by conspiracy theories, Peter Frank said.
Chancellor Angela Merkel said there were many signs Tobias R had acted out of racism.
Speaking in Berlin, the chancellor said: “Racism is a poison. Hate is a poison and this poison exists in our society and is already to blame for many crimes.”
Turkey says at least five of the dead were Turkish citizens. Turkish President Recep Tayyip Erdogan said he expected Germany to “throw light on all aspects” of the attack.
According to the prosecutor, the investigation into the deadly gun attack in Hanau is focusing on whether others knew about or helped organize it.
Peter Frank said six people had also been injured in the attack, one of them seriously.
Shortly after the attacks the suspect and his 72-year-old mother were found in his apartment, both also shot. A gun was found next to the suspect’s body.
The prosecutor said investigators wanted to establish any links the suspect may have had in Germany or potentially also abroad.
The shootings took place around 22:00 on February 19, and the first target was the Midnight shisha bar in the city centre of Hanau. Witnesses reported hearing about a dozen gunshots.
The suspect then traveled by car to the Kesselstadt neighborhood, some 1.5 miles away, and opened fire at the Arena Bar & Cafe.
Shisha bars are places where people gather to smoke a pipe known as shisha or hookah. Traditionally found in Middle Eastern and Asian countries, they are also popular in many other parts of the world.
The shootings sparked a manhunt. Police identified the gunman through information from witnesses and surveillance cameras. On February 20, they stormed the suspect’s home, near the scene of the second shooting.
Hanau, in Hesse state, is a city of 100,000 residents about 15 miles east of Frankfurt.
The victims included German citizens and foreigners aged between 21 and 44, Germany’s federal prosecutor said.
Among the dead were “several victims of Kurdish origin”, the Kon-Med association of Kurds in Germany said. It said it was “furious” that authorities were not doing more to fight extremism.
Tobias R had posted videos and a kind of manifesto on his website, Peter Frank said.
In the manifesto he wrote that people from more than 20 countries including Turkey and Israel should be “destroyed”, AFP reported.
In her statement, Chancellor Merkel said there were “many indications at the moment that the perpetrator acted on right-wing extremist, racist motives, out of hatred towards people of other origins, religion or appearance”.
Hesse state Interior Minister Peter Beuth said the suspect had not previously been known to the authorities.
The Bild tabloid reports the suspect had a firearms license, and that ammunition and gun magazines were found in his car.
Gun laws in Germany are among the most stringent in the world, and were tightened further in recent years after other mass shootings.