The assault took place nearly one year after a far-right gunman attacked a synagogue in the eastern city of Halle on the Jewish holy day of Yom Kippur.
German Foreign Minister Heiko Maas denounced the Hamburg attack as antisemitic and called on Germans to show more civil courage.
"This is not an isolated incident, this is disgusting antisemitism and we must all oppose it!," Maas said in a tweet.
A police spokesman said the 29-year-old attacker was accused of causing grievous bodily harm. The attacker seemed to have acted alone so there was no further threat, he added.
The motive was unclear, the police spokesman said.
The victim suffered serious head injuries after the suspect assaulted them with a shovel, German media reported.
The suspect was wearing military clothes reminiscent of the outfit of the neo-Nazi attacker in Halle, the media reported.
The right-wing gunman attacked the synagogue in Halle on Oct. 9 last year and shot two bystanders after failing to enter the building. The suspect Stephan B. confessed to the crime and is standing trial.
Jerusalem Post Staff contributed to this report.