German Chancellor Angela Merkel condemned as "abhorrent" a rampage in Stuttgart where hundreds of partygoers brutally attacked police officers, her spokesman said Monday, as concerns grow that law enforcers are increasingly treated with contempt.

Hundreds of people unleashed a riot of an "unprecedented scale" in the early hours of Sunday in the city centre of Stuttgart, attacking police and plundering stores after smashing shop windows.

Two dozen people were provisionally arrested, as police reported at least 19 colleagues hurt and close to 40 shops in the district suffering damages.

"Whoever has done this has turned against their city, against the people with whom they live and against the laws that protect us all," Merkel's spokesman Steffen Seibert said of the riots that erupted over the weekend.

Tensions boiled over shortly after midnight when officers carried out checks on a 17-year-old German male suspected of using drugs, Stuttgart deputy police chief Thomas Berger said.

Crowds milling around the city's biggest square, the Schlossplatz, immediately rallied around the young man and began flinging stones and bottles at police.

The groups of mostly men also used sticks or poles to smash windows of police vehicles on the square, which is next to the regional parliament of Baden-Wuerttemberg as well as the state's finance ministry.

At the height of the hours-long clashes, as many as 500 people joined in the battle against police officers and rescue workers.

Interior Minister Horst Seehofer travelled to the city on Monday. He paused at a police vehicle with its windows smashed out as he took stock of the trail of destruction.

Calling the violence a "sign of alarm for the rule of law," Seehofer said the perpetrators must be prosecuted and punished as "punishment is the best means of prevention".

"It's about the credibility of the rule of law here."

German Interior Minister Horst Seehofer called the Stuttgart violence a "sign of alarm for the rule of law"
German Interior Minister Horst Seehofer called the Stuttgart violence a "sign of alarm for the rule of law" AFP / THOMAS KIENZLE

In a statement on Monday, prosecutors said 25 people provisionally detained included a 16-year-old who is accused of attempted manslaughter as he allegedly repeatedly kicked a student, who had criticised the rampage, in the head while the victim was lying on the ground.

Some 16 have been released while the rest have been remanded in custody over charges including serious breach of peace, grievous bodily harm, assault of law enforcement officers and theft.

The nationalities of those detained are German, Croatian, Iraqi, Portuguese and Latvian.

Seehofer meanwhile also pointed to the worrying trend that police and emergency workers were increasingly coming under attack, both physically and verbally.

"Besides the attacks and insults, there is also disparagement -- and that can hurt just like physical violence," he said, stressing that politicians must stand behind the police.

In a speech on Monday, President Frank-Walter Steinmeier sent the same message.

"We must resolutely oppose anyone who attacks police officers, who shows contempt for them or gives the impression that they should be 'disposed of'," he said.

Police unions and emergency workers have been warning of authorities facing greater hostility as they go about their work.

Tensions have also spilled over from the Black Lives Matter demonstrations in the United States where officers are accused of being racist.

In a separate incident in Germany's Lower Saxony state over the weekend, several police officers were injured while enforcing a coronavirus quarantine imposed on 700 residents of a high-rise building.

And the police union DPolG has filed a lawsuit against a columnist of left-leaning daily TAZ over an article titled: "All cops are unfit for the job".

On Monday, Seehofer said he too was considering filing a complaint against the writer, warning that irresponsible speech can lead to dramatic consequences.