Federal prosecutors are treating the case as terrorism. Turkey says at least five of the dead were Turkish citizens.
The 43-year-old suspect killed himself, police say. He was found dead at his home along with the body of his mother.
Local media have identified the suspect as Tobias R, a German citizen. The Bild tabloid reports he had a firearms licence, and that ammunition and gun magazines were found in his car.
What we know so far
Authorities are examining a video that appears to be from the suspect, posted online days before the attacks, in which he expresses right-wing conspiracy theories. German media say he also left a letter of confession.
The attack comes amid growing concerns about far-right violence in Germany. Speaking in Berlin, Mrs Merkel said: “Racism is a poison. Hate is a poison and this poison exists in our society and is already to blame for many crimes.”
What do we know about the attacks?
The shootings took place around 22:00 (21:00 GMT) on Wednesday, 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 travelled in a dark car to the Kesselstadt neighbourhood, some 2.5km (1.5 mile) 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.
Turkey’s President Recep Tayyip Erdogan said he expected the German government to make “necessary efforts to throw light on all aspects” of the attack.