Nine people were killed in two shootings at shisha bars in the western German city of Hanau.
Several other people were also injured after a gunman opened fire at 22:00 local time (21:00 GMT) on Wednesday, police said.
The suspect was later found dead at his home, along with the body of a second person, according to police.
There appeared to be no other perpetrators, they added, and said the investigation was ongoing.
The motive for the attack is unclear.
Bild newspaper reported that the suspect was a German citizen with a firearms licence, and that ammunition and gun magazines had been found in his car.
The first shooting was at Midnight shisha bar in the city centre, while the second was at the Arena Bar & Cafe in Hanau’s Kesselstadt neighbourhood.
The clientele were reported to have been predominantly Kurdish.
The shootings sparked a seven-hour manhunt, while officers searched for what they thought could have been multiple gunmen.
The initial death toll was eight, but this was raised to nine in the early hours of the following morning after one of the wounded victims succumbed to their injuries.
Hanau’s local MP Katja Leikert said it had been a “terrible night”, adding: “Hopefully the injured recover swiftly. It is a horrific scenario for us all.”
Witnesses reported hearing about a dozen gunshots in the first shisha bar.
Can-Luca Frisenna, who works at a kiosk at the scene of one of the shootings, said his father and brother were in the area when the attack took place.
“It’s like being in a film, it’s like a bad joke, that someone is playing a joke on us,” he told Reuters. “I can’t grasp yet everything that has happened. My colleagues, all my colleagues, they are like my family – they can’t understand it either.”
Hanau, in the state of Hessen, is about 25km (15 miles) east of Frankfurt.
In a statement, the state police force said: “The home address was blocked off extensively and searched by special police forces. Two other bodies were found. One of the dead people is most likely the culprit. There are currently no indications of other perpetrators.
“Investigations into the identity of the victims and the suspected perpetrator are ongoing.”
This attack comes four days after another shooting in Berlin, near a Turkish comedy show at the Tempodrom concert venue, which killed one person.
Gun laws in Germany are among the most stringent in the world, and were tightened further in recent years after other mass shootings.