Protesters demonstrate against the Group of 20 economic summit during a protest march on July 8 in Hamburg. (Morris Macmatzen/Getty Images)

For days, protesters seethed. They marched. They chanted. They took over public parks. They refused to obey police commands to disperse. They filled this northern German port city with signs condemning global trade as world leaders descended for the Group of 20 economic summit.

Then, late Friday, violence erupted as far-left militants ravaged parts of Hamburg, setting cars on fire, smashing store windows and looting.

The turmoil created difficult questions for activists who continued to rally Saturday as some made a point of disavowing radical tactics. It also renewed concerns about whether Hamburg — whose more than 1.7 million residents make it the second-largest city in Germany, a country with federal elections several months away — was a wise location for a summit bringing together many divisive heads of state. All together, all at once, in a moment of global unease, were President Trump, Russian President Vladi­mir Putin and Turkish President Recep Tayyip Erdogan.

 Antipathy toward Trump was a particular rallying point in demonstrations that otherwise lacked a unifying theme. Protesters railed variously against capitalism, climate change and national borders, among many other grievances. 

“This summit was supposed to advance the environmental movement,” said Leo Lehmann, 67. “Instead, because of Mr. Trump, we’re going nowhere.”

Bill de Blasio, the mayor of New York City, seized the mantle of international anti-Trump sentiment, announcing at the last minute that he would headline one of Saturday’s demonstrations, “Hamburg Shows Attitude,” sponsored by the city of Hamburg. Another demonstration Saturday unfolded under the banner “G-20 not welcome” and featured a variety of far-left groups, including a group of “black bloc” activists, known for anarchist sympathies and for concealing their faces. Police warned of possible escalation as the summit came to a close Saturday.

Tensions had been running high since Thursday, the eve of talks, as police officers faced off against members of the bloc at an anti-capitalist demonstration dubbed “Welcome to Hell.” Authorities used water cannons and pepper spray to disperse the crowd, which numbered about 12,000. 

The center of the mayhem Friday night was Schanzenviertel, a hub of the city’s left-wing activism not far from where German Chancellor Angela Merkel was hosting the leaders of the world’s major economies for a concert at the lofty Elbphilharmonie. As summit participants listened to “Ode to Joy,” about 1,500 anarchists rioted and looted, attacking police officers with iron bars and lobbing molotov cocktails.

German special forces were deployed as authorities called in reinforcements from across the country. Police said 144 people had been arrested by Saturday evening and the same number were being held temporarily in detention. 

Meanwhile, 285 officers had been injured since protests mounted Thursday. One had a broken limb. Many injures were also reported among protesters, some of whom were sheltered inside Rote Flora, a center of left-wing German radicalism and former theater where activists have squatted for nearly three decades. 

Its leaders Saturday distanced themselves from the violence but dispersed blame. 

“This militant action was wrong,” said Andreas Blechschmidt, a spokesman for Rote Flora who had helped organize the opening march on Thursday. “In general, we say militant resistance is of course for us an option, but this was only rioting with no political aim. Though perhaps it was a reaction to the very strict strategy of the police in the last week.”

The rioting in Schanzenviertel led many to reflect Saturday on how to voice dissent without resorting to violence. Ursula Haun, part of a group of physicians who oppose nuclear arms, said the aim should be to counter brutality, not provoke it.

Thomas Weinand, 25, carried a sign urging, “Black bloc go home.” Across several years living near the scene of Friday night’s chaos, he had never seen anything like the “hell” that unfolded, he said. For several hours, militants lit fires, smashed street signs and looted a grocery store, carrying off piles of food.

Weinand said anarchists from across Europe had hijacked Hamburg’s history of left-wing activism, undermining the cause of peaceful protesters, including many from Hamburg whose aim was to defend their city.

“We don’t want the G-20 here,” said Weinand, who studies management in Hamburg.

German officials Saturday defended the decision to hold the summit in Hamburg, saying adequate precautions had been taken. Wolfgang Schmidt, a Hamburg politician involved in summit preparations, said the city did not regret playing host to world leaders. He said the purpose of sponsoring a demonstration — in the model of the international women’s march after Trump’s inauguration in January — was to give activists an outlet that did not entail condemning the summit itself. 

“I don’t think we can say we shouldn’t have summits in certain places,” Merkel told reporters Saturday, pointing to talks held in London in 2009. Next year’s summit will take place in Buenos Aires.

Other world leaders weighed in as well. French President Emmanuel Macron said: “We’re not talking about activists really but rowdies.”

Vehement protest has often marked international economic talks. A summit in 2001, in Genoa, Italy, became a site of mass anti-globalization demonstrations that left one protester dead at the hands of Italian authorities.