The summit of the world's G20 countries will be held in the German city of Hamburg on July 7-8.
In June, the German authorities introduced border controls in preparations for the summit and banned demonstrations in most of the city for the duration of the summit.
Many Hamburgers are unhappy that their city, which has a reputation for radicalism and left-wing politics, has been chosen for the event.
The focus for their ire has been US President Donald Trump, who is expected to receive a hostile reception because of his views on a range of subjects.
On Sunday, June 2, police said around 8,000 people took part in the demonstration but the organizers said there were more than 18,000 in attendance.
Police said the protest, one of around 30 planned for this week, was "completely peaceful" although there were isolated clashes in the evening and at least one person was arrested.
But Germany's Interior Minister Thomas de Maiziere, writing in the Sunday edition of the Bild newspaper, warned protesters any violence at the summit would be "nipped in the bud."
"Freedom of assembly is only valid for peaceful demonstrations," he added.
On Sunday, while the protesters gathered outside the city hall dozens of people in canoes and kayaks voiced their opinions on the nearby river Alster.
There was also a small Greenpeace demonstration against climate change in the
port of Hamburg, where a ship was loading coal.
The main demonstration heard from speakers from a variety of left-wing organizations in Germany.
"We need a fair distribution of wealth in Germany and across the world," said Stefan Korzell, of the German Trade Union Federation.
Germany's Chancellor Angela Merkel was born in Hamburg but she moved to communist East Germany as a baby when her father, a Lutheran pastor, took up a position near East Berlin.
Mrs. Merkel has agreed to fund the deployment of 15,000 police officers for the summit, at a cost of many millions of euros. Another 3,800 officers will bump up security at the city's airport and train stations.
She insists that Hamburg is a good choice for a G20 summit because of its history as a "beacon of free trade."
But the choice of a conference center in the inner city, close to the St. Pauli district, with its history of anti-establishment protests, seems a strange one.
The German police association spokesman Jan Reinicke has queried the venue and is worried about a repeat of the violence which marked the G8 summit in the Italian city of Genoa in 2001.
"Many of my colleagues and I find it incomprehensible that another big city has been chosen for such a gathering after the terrible events of Genoa. Why Hamburg when you could have held the G20 in, say, a forest in Bavaria or on Heligoland?" he said.