German police say 82 policemen and a number of protesters have been injured in clashes triggered by the eviction of squatters at a left-wing cultural centre in the northern city of Hamburg.

More than 7,000 people demonstrated on Saturday against the closure of the Rote Flora centre, a former theatre that houses squatters and serves as a meeting point for left-wing activists.

Hamburg police said some of the protesters began hurling objects at the 2,000 officers shortly after the demonstration began.

"The protesters suddenly started marching, and this was not what we agreed on with them, so we had to stop the march," said police spokesperson Mirko Streiber. "Then bottles, stones and fireworks were thrown at us, injuring several officers. We had no option but to deploy water cannons."

After the protesters were dispersed, about 1,000 protesters roamed the streets and attacked supermarkets, banks and the police, a police spokesman said.

Prior to the demonstration, police had declared parts of the inner city a "danger zone," giving law enforcement extended rights to search and detain people without initial suspicion.