Berlin (CNN) A gunman suspected of killing nine people at two shisha bars in Germany is believed to have a far-right background, prosecutors said Thursday, sparking outrage across the country as it grapples with the rise of rightwing extremism.

The attack took place on Wednesday night at multiple locations in the city of Hanau, near Frankfurt. Federal prosecutors are treating the mass shooting -- one of the deadliest in Germany in years -- as an act of terrorism.

Authorities believe the suspect, 43, returned home after the rampage and shot himself. He was found dead in his apartment early Thursday, along with the body of his 72-year-old mother. Both died from gunshot wounds, according to the region's interior minister, Peter Beuth.

Chancellor Angela Merkel said the suspect appeared to have acted out of "right-wing extremist, racist motives" and described hatred as a poison in German society. Prosecutors said the suspect did not have a criminal record but had posted xenophobic conspiracy theories online.

Shooting spree at shisha bars

The rampage began around 10 p.m. and appears to have centered around two shisha bars in immigrant areas of the city. After opening fire at the Midnight shisha bar, the suspect then fled by car to the Arena Bar and Cafe, where the attack continued.

Shisha bars, or flavored tobacco bars, first started in the city's Turkish community, and in recent years have become popular among young German people.

Kadir Koese, a 38-year businessman who runs a bar across from one of the bars that was attacked, said he heard shots being fired.

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

Can-Luca Frisenna, whose family members run one of the bars that came under attack, said he rushed to the scene after hearing about the shooting.

"I heard my father was affected and my little brother, they run the kiosk," Frisenna told Reuters. "They were horrified and they were crying and everything. So everyone was shocked."

Police officers guard the entrance of a bar where several people were killed late Wednesday in Hanau, Germany.

Turkey called the shooting a "racist attack" and said five of its citizens were among the dead. German authorities have not yet publicly confirmed the nationalities of the victims, but prosecutors said the victims' ages ranged from 21 to 44, and that both foreign and German nationals were killed. Six others were injured in the attacks, one of them seriously.

The suspect left a confession letter and a video, according to CNN affiliate RTL, citing police. His apartment was blocked off and searched by special forces, and police said there were no indications that other perpetrators were involved. Officials said the suspect's father was "met unharmed" by police, but didn't elaborate on where he was found or whether he was arrested.

While the police only named the shooter as Tobias R., they also released information about his place and date of birth. Those details match what a man called Tobias Rathjen published on his personal website.

Federal prosecutor Peter Frank told reporters that the website of the alleged killer contained a "kind of manifesto" that included "confused thoughts", "conspiracy theories", and displayed a "deeply racist attitude". The website has been taken down.

YouTube said it shut down the account of a man named Tobias Rathjen on Thursday morning. The most recent video, which was uploaded on February 14, linked to Rathjen's personal website.

The suspect had a legal gun license, Beuth said. According to Germany's national firearms register , there were 5.7 million privately-owned guns and 1.5 million gun owners as of 2015.

A screengrab of suspect Tobias Rathjen

'Our warnings were ignored'

In the wake of the shootings, Germany's Foreign Minister Heiko Maas condemned the spread of right-wing attacks.

"If the suspicion is confirmed, the gruesome act in Hanau is the third extreme right-wing murder attack in Germany in a year," he said. "Right-wing terrorism has again become a threat to our country. There is absolutely nothing to put into perspective."

Recent far-right attacks in Germany June 2019: Pro-migrant mayor, Walter Lübcke, is shot dead on the terrace of his home in the small village of Istha, in central Germany, by a far-right supporter. October 2019: Two people are killed in a shooting spree in the town of Halle -- one outside a synagogue and one at a nearby kebab shop, on Yom Kippur, the holiest day in the Jewish calendar. February 2020: Nine people killed at two shisha bars in the town of Hanau by a gunman with extremist links.

In October, a gunman killed two people in an attack on a synagogue in Halle, while streaming the rampage live from a camera on his helmet. He later admitted to the attack and to holding anti-Semitic and far-right views.

Germany's Islamic Association claimed that Muslims were the gunman's "target group."

"Before this right-wing terror we had been warning and demanding for weeks and months to take a clear stand against right-wing agitation and Islamophobia," its statement said. "We had also warned that terror threatens us all -- Muslims and non-Muslims alike. Our warnings were ignored. The terror has struck. It is now the time to stand together."

Merkel, who canceled a planned trip to the city of Halle in the wake of the attack, said the evidence overwhelmingly pointed to extremist motives.

"It is still too early for a final evaluation. Everything is being done to clear up the background of these horrible murders to the last detail. But at present there is much evidence that the perpetrator acted out of right-wing extremist, racist motives -- out of hatred against people of other origins, other beliefs or other outward appearances," Merkel said from Berlin.

Forensic experts work around a damaged car after the attack in Hanau.

"Racism is a poison, hatred is a poison," Merkel added. "I think now especially of the families and friends of the murdered. None of us can measure the suffering that the perpetrators brought upon them. I mourn with them and express my deepest sympathy."

The far-right Alternative for Germany party said it was "shaken by this terrible act."

"We believe that it is in the interests of the relatives of the victims if the crime and its background are clarified quickly," it added in a statement.

The regional parliament in Hesse, the state where Hanau is located, suspended all sessions Thursday.

A vigil for the victims in Hanau on Thursday evening turned into an impromptu protest against extremism, with some attendees carrying signs denouncing racism and xenophobia.

Correction: The age range of the victims has been updated.