The suspected perpetrator of two deadly gun attacks in Germany's Hanau city appeared to have had a far-right motive, according to German federal prosecutors and a state interior minister.

The suspect, a 43-year-old German man, killed at least nine people in two shisha bars on Wednesday before returning home and killing himself, security officials said on Thursday.

Police found him and his 72-year-old mother dead in an apartment.

More:

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

Peter Beuth, the interior minister of the German state of Hesse, later said the attack was being treated as a terrorism case. He also said the suspect was in legal possession of arms and was a sports marksman.

200220073658913

Earlier, the German Bild newspaper reported that the gunman left a letter and a nearly one-hour online video confession in which he said that Germany was being run by a secret agency with wide-ranging powers.

He also gave negative statements about migrants from Middle Eastern countries and Turkey, the report said.

King's College London counterterrorism expert Peter Neumann tweeted that the text contained "various, but mostly extreme right views, with a do-it-yourself ideology cobbled together out of parts found on the internet".

"The pattern is clear, and not at all new," he added.

Ibrahim Kalin, a spokesman for the Turkish presidency, said some of those killed were of Turkish origin.

Kalin said on Twitter: "We expect German authorities to show maximum effort to enlighten this case. Racism is a collective cancer."

Previous attacks

Germany has experienced several far-right attacks recently.

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.

200217120716874

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 dead at his home.

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

After the news of the cell was made public, German-Turkish Islamic organisation Ditib, which funds about 900 mosques in Germany, called for greater protections for Muslims in the country, saying they "no longer feel safe" in Germany.