Thousands of people protested outside the Hamburg offices of the far-right Alternative for Germany (AfD) party on Thursday evening, in the wake of Wednesday's double shooting in Hanau.
Protesters chanted anti-AfD slogans, with many holding signs denouncing racism and fascism as they marched through the area.
German President Frank-Walter Steinmeier condemned the attack as a "brutal terrorist crime" at a vigil in Hanau on Thursday.
According to Germany's Federal Prosecutors Office, there are serious indications of a racist background to the crime, which is supported by videos and documents allegedly made by the suspect.
A gunman opened fire outside one shisha bar in Hanau's Heumarkt district and drove off to a second location in the Kesselstadt district where he opened fire again, killing a total of nine people and injuring several others late on Wednesday evening.
The attacker was a 43-year-old German citizen from Hanau. Together with his 72-year-old mother, he was found dead at his home in the early hours of Thursday morning.