A gunman suspected of shooting at least nine people dead at two shisha bars in a German city revealed he had far-right political views in a confession letter he left behind.

The rampage late on Wednesday in Hanau, a town close to Frankfurt in the western state of Hesse, ended with the suspect killing himself.

German daily Bild said the man had left a written confession and a video claiming responsibilty for the attack.

Police chased a car used to leave the scene of one shooting to its owner's address, where they found the bodies of a 43-year-old German man and his 72-year-old mother, Hesse interior minister Peter Beuth said.

Some of the victims were migrants from Turkey, officials said, while federal prosecutors said they had taken charge of the case due to indications that the attack had an extremist motive.

Germany mass shooting: 9 dead at Hanau shisha bars Show all 15 1 /15 Germany mass shooting: 9 dead at Hanau shisha bars Germany mass shooting: 9 dead at Hanau shisha bars Forensics investigate at the scene after a shooting in central Hanau. A German man shot and killed eleven people at different locations in a Frankfurt suburb overnight AP Germany mass shooting: 9 dead at Hanau shisha bars Special police forces work at the scene following the deadly shooting AP Germany mass shooting: 9 dead at Hanau shisha bars A car were people were shot dead AP Germany mass shooting: 9 dead at Hanau shisha bars Broken glass one the floor by the car AP Germany mass shooting: 9 dead at Hanau shisha bars Police secure the area after the shooting Reuters Germany mass shooting: 9 dead at Hanau shisha bars Police and ambulances at the crime scene EPA Germany mass shooting: 9 dead at Hanau shisha bars epa08229669 Police work at a crime scene after two shootings in Hanau, near Frankfurt, Germany, 20 February 2020. According to media reports, at least eight people were killed in two shootings at shisha bars in the western German city on the outskirts of Frankfurt on 19 February 2020. EPA/ARMANDO BABANI ARMANDO BABANI EPA Germany mass shooting: 9 dead at Hanau shisha bars Police officers secure an area after a shooting in Hanau near Frankfurt, Germany, February 20, 2020. REUTERS/Kai Pfaffenbach KAI PFAFFENBACH Reuters Germany mass shooting: 9 dead at Hanau shisha bars Forensic experts search the area Reuters Germany mass shooting: 9 dead at Hanau shisha bars A bullet lies on the sidewalk near a restaurant AP Germany mass shooting: 9 dead at Hanau shisha bars epa08229721 A forensic expert investigates a crime scene after two shootings in Hanau, near Frankfurt, Germany, 20 February 2020. According to media reports, at least nine people were killed in two shootings at shisha bars in the western German city on the outskirts of Frankfurt on 19 February 2020. The alleged perpetrator was found dead in his flat together with another dead person in Hanau, police stated on twitter. EPA/HEIKO HAHNENSTEIN HEIKO HAHNENSTEIN EPA Germany mass shooting: 9 dead at Hanau shisha bars Forensic police work near a crime scene in front of a bar at the Heumarkt in the centre of Hanau, near Frankfurt am Main, western Germany, on February 20, 2020, after at least nine people were killed in two shootings late on February 19. - At least nine people were killed in shootings targeting shisha bars in Germany that sparked a huge manhunt overnight before the suspected gunman was found dead in his home early on February 20. The attacks occurred at two bars in Hanau, about 20 kilometres (12 miles) from Frankfurt, where armed police quickly fanned out and police helicopters roamed the sky looking for those responsible for the bloodshed. Police in the central state of Hesse said the likely perpetrator had been found at his home in Hanau after they located a getaway vehicle seen by witnesses. Another body was also discovered at the property. German counter-terror prosecutors said on February 20 they had taken over the investigation into two linked shootings. (Photo by Thomas Lohnes / AFP) (Photo by THOMAS LOHNES/AFP via Getty Images) THOMAS LOHNES AFP via Getty Germany mass shooting: 9 dead at Hanau shisha bars Police officers secure one of the bar targets AFP via Getty Germany mass shooting: 9 dead at Hanau shisha bars A forensic officer walks into the hookah bar where several people were killed late Wednesday in Hanau, Germany, Thursday, Feb. 20, 2020. Several people were killed at locations when shots were fired in Hanau late Wednesday, with the suspect and another person found dead at his home afterwards.(AP Photo/Martin Meissner) Martin Meissner AP Germany mass shooting: 9 dead at Hanau shisha bars Flowers and candles are placed near the Midnight Shisha bar Reuters

Turkey's ambassador to Germany said five of those killed were Turkish citizens.

"We expect German authorities to show maximum effort to enlighten this case. Racism is a collective cancer," tweeted Ibrahim Kalin, a special adviser to Turkish president Recep Tayyip Erdogan.

German magazine Focus cited security sources as saying many of the victims had an immigrant background.

Germany's political landscape has been polarised in recent years, with a wave of immigration and a slowing economy helping to fuel support for extremist groups at both ends of the spectrum.

In October, an antisemitic gunman opened fire outside a German synagogue on Yom Kippur, the holiest day of the Jewish year, and killed two people as he livestreamed his attack.

Authorities have banned some far-right groups endorsing violence, while Germany's post-war centrist political consensus has been undermined by growing support for the anti-immigrant Alternative for Germany (AfD) party, notably in the former-Communist eastern states.

Police said work to confirm the identities of the two bodies at the home was under way, and they could not immediately give details on them or the identities of the earlier victims.

It is believed the gunman returned home after his rampage and shot himself. Officers said there were no indications other suspects were involved in the attack.

Mr Beuth said the suspect was in legal possession of arms and was a sports marksman, and Bild said ammunition and gun magazines were found in the suspect's vehicle.

Can-Luca Frisenna, whose father and brother run one of the two bars attacked, said he rushed there after learning about 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."

At one of the bars on Thursday morning, forensics police in white overalls inspected the crime scene, cordoned off close to Hanau's historic market place. Nearby, traffic flowed as normal and commuters waited for buses.

In shisha bars, customers share flavored tobacco from a communal hookah, or water pipe. In Western countries, they are often owned and operated by people from the Middle East or South Asia, where use of the hookah is a centuries-old tradition.

Kadir Koese, a 38-year businessman who runs a bar opposite one of those attacked, described hearing shots being fired.

"There was a guy lying on the sidewalk, shot in the head, I think. My neighbour said 'get down'. The police came quickly," he said.

Government spokesman Steffen Seibert tweeted: "Deep sympathy goes out to the families concerned, who are mourning the loss of their dead. With the injured, we hope they will soon recover."

European Commission president Ursula von der Leyen, who is German, said in a tweet she was deeply shocked by the shooting and that she mourned with the families and friends of the victims.

"Thoughts this morning are with the people of Hanau, in whose midst this terrible crime was committed," German chancellor Angela Merkel's spokesman said on Twitter.

"Deep sympathy for the affected families, who are grieving for their dead," the spokesman, Steffen Seibert, said. "We hope with those wounded that they will soon recover."

Hanau mayor Claus Kaminsky told Bild: "This was a terrible evening that will certainly occupy us for a long, long time and we will remember with sadness."

Legislator Katja Leikert, a member of Ms Merkel's centre-right Christian Democrats (CDU) party who represents Hanau in the German parliament, tweeted that it was "a real horror scenario for us all", while the leader of the CDU said xenophobia was a growing problem in Germany.

"It's poison to see people as opponents, to see yourself as better than others, to see fellow citizens as foreigners - that's a poison that is increasingly penetrating society and can ultimately lead to these crimes," Annegret Kramp-Karrenbauer said.