“What happened last night has nothing to do with legitimate criticism,” said Massimo Gugliotta, who was surveying a charred pile of rubble in the Schanzen district early Saturday. “Whoever did this was just using the idea of protest as an excuse for violence.”

Major streets in the city were blocked off to allow delegations of leaders to go to and from meetings. But many Hamburg residents, whose lives had been disrupted by the events, said they hoped to show that legitimate protests could be peaceful, and effective.

One contingent of about 12,000 people, galvanized by the theme “Solidarity Instead of G20,” began gathering early Saturday, the police said. Jan van Aken, a lawmaker with the Left Party, organized the demonstration with several other groups, including the Hamburg Refugee Council, local environmentalists and the Communist Party.

“Join the masses to send a signal against the G20, against the escalation and against meaningless violence,” Mr. van Aken said in a Twitter message. “Come out, now more than ever!”

In another part of the city, church and community leaders joined local politicians from Hamburg’s centrist parties to organize a demonstration that proclaimed “Hamburg Shows Attitude.” Several hundred people marched with blue, pink and yellow balloons, while others held signs with messages like “Make Global Trade Fair” and “Stop the Violence.”

Among the protesters was Michael Schmidt, 80, a writer, who had traveled to Hamburg from Munich with his son.

“We are fed up with the system” perpetuated by the Group of 20, Mr. Schmidt said. He denounced “the unquestioning of the capitalist system, the social irresponsibility and ecological irresponsibility” of the member nations. The Group of 20 comprises 19 industrial and emerging-market countries, plus the European Union.