The "Welcome to Hell" rally kicked off on Thursday afternoon, Xinhua news agency reported.
Police had to use water cannon, pepper sprays and batons to disperse the demonstrators.
Hamburg police said on its Twitter account that the number of protesters rose to 12,000 in the evening. Police called on all peaceful demonstrators to distance themselves from these violent protesters.
"Violent men equip themselves with scaffolds and stones. We are appalled at the obvious violence," the Hamburg police said. A burning car was reported.
In various places in Altona and St. Pauli in Hamburg, attacks on police forces and property damage were reported, Hamburg police said on Twitter, adding the figure of the injured is not yet known.