At least nine people were killed at two shisha lounges in a German city on Wednesday evening, an assault that federal prosecutors are investigating as a possible far-right attack.

The suspect was later found dead at his home early on Thursday after the shootings in Hanau, 25km (12 miles) east of Frankfurt. Another body was found at the suspect's home.

More:

There are indications that the suspect had a far-right motive, German federal prosecutors said.

"Federal prosecutors have taken over the investigation and there are indications of a right-wing extremist background," said a spokesman for the prosecutors.

Police believe the gunman returned home after his rampage and shot himself.

"There are no indications that other suspects were involved," police said in a statement. "One of the two dead people found is highly likely the perpetrator. The investigations into the identity of the victims and the perpetrator are ongoing."Police did not give details of the suspect's possible motive or how he died.

Bild, a popular German tabloid newspaper, reported that the gunman expressed right-wing views in a letter of confession he left behind. The police could not immediately be reached for comment.

Can-Luca Frisenna, whose father and brother run one of the two bars attacked by the gunman, said he rushed to the scene after he received news of the shooting.

"I heard my father was affected and my little brother, they run the kiosk, I don't have much to do with it," said Frisenna. "But then I saw them both - they were horrified and they were crying and everything. So everyone was shocked."

Police officers sealed off and searched the suspect's apartment in Hanau's Kesselstadt district, near the scene of one of the shootings, after following up witness statements on a getaway car.

Public broadcaster Hessischer Rundfunk earlier reported that the first shots were fired at a shisha bar in the city centre, with witnesses saying they had heard eight or nine shots.

Forensic experts are seen outside one of the two shisha bars targeted in the late-night attack on Wednesday [Kai Pfaffenbach/Reuters]

The report said that "the perpetrators" then drove to the western neighbourhood of Kesselstadt before shots were fired again at another shisha bar.

A third reported shooting in the northern neighbourhood of Lamboy was not confirmed, but a large police contingent was in the area, the dpa news agency reported.

'Terrible evening'

Claus Kaminsky, the mayor of Hanau, said it was "an evening that you can hardly imagine being any worse".

"It was a terrible evening, that will surely occupy us for a long, long time and stay with us in sad memories," he told Bild.

Breaking and Exclusive from #Hanau #Germany , you can hear the ongoing gun shots in the background , this is terrifying! pic.twitter.com/aIN9Daf5Hi — Steven Nabil (@thestevennabil) February 19, 2020

Katja Leikert, a parliamentarian for the Hanau constituency, wrote on social media that it was a "true horror scenario for us all".

Police have set up a hotline for members of the public with information that could lead to the suspects.

Germany has suffered several attacks in recent years, one of which, claimed by ISIL, killed 12 people in the heart of Berlin in December 2016.

Far-right attacks have become a particular concern for German authorities.

Germany has had several violent attacks in recent years, one of which killed 12 people in the heart of Berlin in December 2016 [ Michael Probst/AP]

In October, a deadly anti-Jewish gun attack in the eastern city of Halle on the holy day of Yom Kippur underscored the rising threat of neo-Nazi violence. The rampage, in which two people were shot dead, was streamed live.

Last June, conservative politician Walter Luebcke, an advocate of a liberal refugee policy, was shot at his home.

On Friday, police arrested 12 members of a German far-right group believed to have been plotting "shocking" large-scale attacks on mosques similar to the ones carried out in New Zealand last year.