A GERMAN man has shot and killed nine people at several locations in a Frankfurt suburb in attacks that appear to have been motivated by far-right beliefs, officials said.

The gunman first attacked a hookah bar in central Hanau at about 10pm on Wednesday, killing several people, before heading about 1.5 miles west and opening fire again, claiming more victims.

Hookah lounges are places where people gather to smoke flavoured tobacco from Middle Eastern water pipes, and some of the victims appeared to be Turkish.

Chancellor Angela Merkel said that while the circumstances of the attack still need to be fully investigated, the shootings exposed the "poison" of racism in German society and she pledged to stand up against those who seek to divide the country.

Witness Kadir Kose said he ran over from a cafe he runs nearby after he heard the first shots, initially assuming there was an altercation between family members.

"But when I heard the second shots, I thought it was a terror attack," Kose said.

He said he was shocked at the extent of the violence, saying that while fights or stabbing are not unheard of, "this is a whole other level, something we hear about from America".

Witnesses and surveillance videos of the suspect's getaway car led authorities to his home, near the scene of the second attack, where he was found dead near the body of his 72-year-old mother, said Peter Beuth, the interior minister for the state of Hesse.

Neighbour Dieter Hog said he looked out of his window and saw 25 or 30 police officers with dogs combing the area.

"They were running around looking for the fugitive who was involved," Hog said, adding that even though he lived close by he did not know the suspect.

Both the suspect and his mother had gunshot wounds, and the weapon was found on the suspect, Beuth said.

A website believed to be the 43-year-old suspect's is being evaluated, he said.

"Initial analysis of the web page of the suspect indicate a xenophobic motivation," Beuth added.

It does not appear, however, that the suspect was known either to police or Germany's domestic intelligence agency, he said.

Beuth said federal prosecutors have taken over the investigation of the crime and are treating it as an act of domestic terrorism.

"This is an attack on our free and peaceful society," he said.

Following a conference call with Germany's state interior ministers, Bavarian interior minister Joachim Herrmann said on the basis of the investigation so far, "it was a right-radical xenophobic" attack, German news agency dpa reported.

The attack was quickly and broadly condemned by many organisations, including the Central Council of Muslims, the Confederation of Kurdish Associations in Germany, and the Central Council of Jews.

Merkel pledged that "everything will be done to investigate the circumstances of these terrible murders".

In unusually plain words, the German leader said: "Racism is a poison. Hatred is a poison."

"This hatred exists in our society and it is responsible for far too many crimes," she added, citing the killings committed by a far-right gang known as the NSU, the shooting of a regional politician from her party last year and the attack on a synagogue in Halle in October.

She added that authorities would do everything possible to stand up to those who try to divide the country with racism.

French President Emmanuel Macron tweeted it was a day of "immense sadness" and pledged his "full support for Germany".

"I'm at the side of Chancellor Merkel in her fight for our values and the protection of our democracies," he said.

Turkey's foreign minister Mevlut Cavusoglu said the consulate in Frankfurt and the embassy in Berlin are trying to obtain information on the attack, including the possibility that some of the victims were Turkish..

"According to the initial information, it was an attack with a racist motive, but we would need to wait for the (official) statement," he told state television TRT.

German news agency dpa reported that police are examining a video the suspect may have posted online several days ago, detailing a conspiracy theory about child abuse in the US.

On a website registered by someone with the same name as the man in the video, Tobias R, the owner says he was born in Hanau in 1977 and grew up in the city, later training with a bank and completing a business degree in 2007.

The attack comes amid growing concerns about far-right violence in Germany.

Merkel called off a planned visit on Thursday to a university in Halle.

Her spokesman Steffen Seibert said she was "being constantly kept abreast of the state of the investigations in Hanau".

Halle was the site of a deadly anti-Semitic attack last year. A man expressing anti-Jewish views tried to shoot his way into a synagogue, failed and killed two passers-by before being arrested.

The shooting in Halle came months after the killing of a regional politician from Merkel's party. The suspect had a long history of neo-Nazi activity and convictions for violent crime.

"Thoughts this morning are with the people of Hanau, in whose midst this terrible crime was committed," Seibert said on Twitter. "Deep sympathy for the affected families, who are grieving for their dead. We hope with those wounded that they will soon recover."

In addition to those killed, Beuth said one person was seriously wounded and multiple others suffered less serious injuries.

Hanau is about 12 miles east of Frankfurt, and has about 100,000 inhabitants.