Germany will deploy extra police to protect mosques, railway stations, airports and other sensitive sites because of a "very high" far-right threat following the Hanau killings, the interior minister says.
Horst Seehofer said he had agreed the measures with regional leaders, to prevent any copycat attacks.
Prosecutors say the suspected gunman, now dead, was "deeply racist".
Nine people were killed in shisha bars in the western city on Wednesday.
"The security threat from right-wing extremism, anti-Semitism and racism is very high," Mr Seehofer said. He called it "the biggest security threat facing Germany".
Muhammed B, a wounded survivor, described from his hospital bed how the gunman took careful aim at the victims in the Arena Bar & Cafe.
"Everyone he saw, he just shot them straight in the head. He laid down, then he fired at all of us. I hid behind a wall, and as I was moving to hide he shot me in the arm," he told a Turkish TV interviewer.
"It was a bloodbath... We were all lying on top of each other. The guy lying under me had a hole in his neck, he said 'I can't breathe, I can't feel my tongue'," Muhammad recalled through tears. He said he told the young man to recite a final prayer, which he did.
Who were the victims?
Investigators say all the shisha bar victims were of immigrant origin - some were German nationals, while Turkey says at least five had Turkish citizenship. Several were reported to be ethnic Kurds.
The dead also included one person each from Bosnia-Herzegovina, Bulgaria and Romania.
At the scene: innocent victims mourned
BBC Europe reporter Gavin Lee in Hanau writes:
Outside the Arena shisha bar this morning, families of the six victims killed here gathered. One young woman collapsed close to the floral tributes, screaming that her sister had been taken from her. Her sister was Mercedes Kierpacz, a 35-year-old German of Sinti Roma heritage. She'd come out that night to buy a pizza and a drink from a nearby kiosk when she was shot dead.
Mercedes' father Filip is shaking and in tears as he tells me his daughter was "the most lovely human being, with two children", and that he feels "utterly lost without her".
A West African woman, Barbara, lights a candle, crying. Originally from Cameroon, she says her 18-year-old son Peter Minnaman was shot and wounded, but survived by playing dead inside the bar when the gunman walked past those he'd shot to check if they were breathing.
There are people in the community who say they saw this coming, who say that hate speech has been an increasingly commonplace thing, and they lay blame on the right-wing German politicians of the AfD party, and their populist anti-migrant rhetoric.
One local, Yusuf, who lives close to the Arena bar, showed me a wall nearby, where police recently covered up graffiti. Written on the wall in huge letters, he said, was something from the suspect's website, written weeks ago.
Tens of thousands of people attended vigils for the victims on Thursday night, in Hanau and Berlin, carrying candles and white roses in silence.
The attack, attributed to a 43-year-old German named Tobias R, is being treated as an act of terrorism.
In her response to the attack Chancellor Angela Merkel condemned the "poison of racism".
What happened in the shootings?
The shootings began around 22:00 (21:00 GMT) on Wednesday, and the first target was the Midnight shisha bar in Hanau.
The suspect then travelled by car to the Kesselstadt neighbourhood, some 2.5km (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.
Police identified the gunman through information from witnesses and surveillance cameras. Early on Thursday, they stormed the suspect's apartment, near the scene of the second shooting.
The suspect and his 72-year-old mother were found, both also shot. A gun was found next to the suspect's body.
The investigation is now focusing on whether others knew about or helped organise the attack. The suspect may have had far-right contacts in Germany or abroad.
What is known about the suspect?
Tobias R had posted videos and a kind of manifesto on his website, the federal prosecutor said.
In the document he wrote that people from more than 20 countries including Turkey and Israel should be "destroyed", AFP reported.
London-based German counter-terrorism expert Peter Neumann said the text contained "various, but mostly extreme right views, with a do-it-yourself ideology cobbled together out of parts found on the internet".
According to federal prosecutor Peter Frank, Tobias R contacted the prosecutors in November, urging them to act against a big secret organisation, which he claimed was tapping into people's brains in order to control world events. No action was taken in response.
The Bild tabloid reports that Tobias R had a firearms licence, 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.
Recent far-right attacks in Germany
- October 2019: In Halle, an attacker kills two and tries to storm a synagogue, broadcasting the assault live online. He later admits a far-right, anti-Semitic motive for the attack
- June 2019: Walter Lübcke, a pro-migrant politician, is shot in the head at close range and found dead in his garden. A suspect with far-right links later confesses to the murder
- July 2016: An 18-year-old shoots dead nine people at a shopping mall in Munich before killing himself. Bavarian authorities later classify the attack as "politically motivated", saying the teen had "radical right-wing and racist views"