Hours after police found the suspected gunman dead at his home in the early hours of Thursday following a huge manhunt, federal counter-terror prosecutors took over the case.
The probe was of “particular importance” and there were “signs of a xenophobic motive”, a spokesman for the prosecutors told AFP.
Sources close to the investigation confirmed media reports that text and video material was found at the home of the perpetrator, who media reported was a 43-year-old man identified only as Tobias R.
King's College London counter-terrorism expert Peter Neumann tweeted of the text that it 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.
Meanwhile media including public broadcaster ARD reported that a second body discovered at the property belonged to the man's mother.
Chancellor Angela Merkel on Thursday condemned the “poison” of hatred and racism running through German society.
“Racism is a poison, hatred is a poison and this poison exists in our society and it is already to blame for far too many crimes,” Merkel told reporters.
'A dozen shots'
The attacks occurred at two bars in Hanau, about 20 kilometres 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.
“The suspected perpetrator has been found dead,” police in the central state of Hesse said, adding: “There is currently no indication that there are additional perpetrators.”
The mass-circulation Bild said that those killed in the first bar were of Kurdish origin.
The first attack occurred at the “Midnight” bar in the centre of the city around 10pm, reports said. Three people were killed in front of the building, local media said, with witnesses reporting hearing a dozen shots.
The attacker, or attackers, fled the scene by car, according to police. There was then a second shooting at the “Arena Bar”.
A gunman reportedly rang the doorbell and shot people who were in the smoking section, killing five people including a woman, Bild said.
“The victims are people we have known for years,” said the bar manager's son, quoted by DPA news agency. Two employees were among the victims, according to the man, who was not at the bar during the shooting. “It is a shock for everyone”.
Police said one of those injured in the attack had also died.
Earlier reports said five people had been seriously wounded.
An AFP journalist at the scene saw around 30 police cars leaving Hanau police station. Witnesses said heavily armed police officers were deployed in the city.
A silver Mercedes-Benz covered by what looked like a survival blanket could be seen behind a police cordon and surrounded by officers in front of the “Arena Bar”, with shattered glass on the floor.
“The search for suspects is going at top speed. There is no clear information yet as to a motive,” authorities said.
Hanau has a population of about 100,000.
The mayor of Hanau, Claus Kaminsky, told Bild that it had been “a terrible night”.
“You could not imagine a worse night. It will of course keep us busy for a long, long time and remain a sad memory.”
“I am deeply moved. Just the fact that eight people have lost their lives has shaken me up. But I ask all citizens not to speculate.
“The police must have the chance to clear up the situation and investigate — until then, we should wait with prudence, no matter how hard this may be.”
Katja Leikert, the MP for the region, said it was “a real horror scenario”.
“On this dreadful night for Hanau, I would like to express my deepest condolences to the relatives of those killed. I hope the injured will recover quickly,” she said.
Counter-terror prosecutors take over
German counter-terror prosecutors said Thursday they had taken over the investigation into the shootings.
Germany has been targeted in recent years by a number extremist attacks, the biggest of which killed 12 people in the heart of Berlin in December 2016.
But far-right attacks have become a particular concern for German authorities.
In October, a deadly anti-Semitic 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.
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.