BERLIN/INGOLSTADT, Germany (Reuters) - German Interior Minister Thomas de Maiziere said on Monday that some anti-capitalist protesters at the G20 summit in Hamburg at the weekend were “criminal anarchists” who had acted like neo-Nazis or Islamist terrorists.

German Interior Minister Thomas de Maiziere attends the weekly cabinet meeting at the Chancellery in Berlin, Germany, July 5, 2017. REUTERS/Axel Schmidt

De Maiziere, a member of Merkel’s conservatives, said a triple-digit number of foreigners intent on violence had traveled to Hamburg from abroad for the protests while hundreds of other left-wing extremists had been rejected at the borders.

He said it would make sense to have a European database on left-wing extremists, who had spent up to two years preparing for the summit and had secretly taken slingshots and other objects to Hamburg long before the G20 leaders arrived.

Justice Minister Heiko Maas, a member of the Social Democrats, the junior party in the ruling coalition, said authorities had lacked relevant data from some European countries about violent extremists who traveled to Hamburg.

Maas told German broadcaster NDR he backed creation of a database of left-wing extremists, but said it could take a long time to set up. In the meantime, countries should at least exchange data about those convicted of violent acts, he said.

About 20,000 police struggled to contain several hundred demonstrators who torched cars, looted shops and hurled Molotov cocktails and stones during the July 7-8 summit. Tens of thousands more people demonstrated peacefully.

The violence has angered Germans and raised awkward questions for Chancellor Angela Merkel less than three months before an election.

“The brutality with which extremely violent anarchists have proceeded in Hamburg since Thursday is unfathomable and scandalous,” de Maiziere told reporters.

Militants who burned cars or plundered supermarkets were not activists or G20 opponents but rather “despicable violent extremists just like neo-Nazis and Islamist terrorists”, the interior minister said.

He added that people who had thrown paving slabs from rooftops had essentially been “preparing attempted murder”.

Martin Schulz, the Social Democrat (SPD) challenger to Chancellor Angela Merkel in Germany’s national election in September, said the militants had acted like terrorists.

He said the “marauding gangs” could not claim to have any political legitimacy for their actions, adding: “It had the characteristics of terrorism.”

“Such small-minded skirmishes are the business of people who took a whole city hostage for their dim-wittedness in an almost terrorist manner,” said Schulz, whose party is trailing Merkel’s conservatives in the opinion polls.

Police said almost 500 officers were injured during the protests, with 186 people arrested and 225 taken into custody.

Some commentators have criticized Merkel’s choice of Hamburg, a seaport with a strong radical leftist tradition, to host the meeting, saying her desire to demonstrate her commitment to freedom of speech had backfired.

Merkel has promised compensation to those who had property damaged.

De Maiziere said he expected judicial authorities to pass tough sentences on the militants and added that breaching the peace could result in prison sentences lasting several years.