Thousands of demonstrators have gathered in Hamburg in advance of the two-day G20 summit in the northern German city.

Officials said on Wednesday they were expecting tens of thousands to protest against the international forum for governments and central bank governors of the world's 20 major economies.

Police said they have also been tracking down known activists coming in from Scandinavia, Switzerland, Italy and elsewhere.

READ MORE: Five things to know about Donald Trump's European tour

Hamburg police said it is boosting its units with reinforcements from around the country, and will have 20,000 officers on hand to patrol the city's streets, skies and waterways when world leaders and 6,500 other delegates start arriving on Thursday.

Germany's counterterrorist GSG9 force will be assisted by Austria's counterpart Cobra and specialists from the Netherlands and other countries, Hamburg police chief Ralf Martin Meyer told AP news agency.

They will be be stationed around the city in strategic locations to help protect the summit participants.

"G20: Welcome to Hell" is the slogan anti-globalisation activists have adopted for their protests.

"We are calling on the world to make Hamburg a focal point of the resistance against the old and new capitalist authorities," according to a statement by one of the protest groups with links to the leftist demonstrators Rote Flora.

In a preview of what's likely to come, police clashed in Hamburg with hundreds of protesters on Tuesday night, using pepper spray and water cannon to against the crowd.

'Planet Earth First'

On Wednesday, Greenpeace activists flew a hot air balloon reading "Planet Earth First" to protest the United States' climate policy.

Among those attending the G20 gathering is US President Donald Trump, who announced that he was withdrawing the US from the landmark Paris climate agreement, to the regret of a number of world leaders who had lobbied him to remain in the 2015 pact.

"We're looking for the G20, and if that's not possible, then the G19, to go forward with implementing the Paris agreement and maybe doing even more," Greenpeace International's executive director Jennifer Morgan told The Associated Press.

Like many nonprofits, Greenpeace is fighting a security decision to block off a 38sq km "no-protest zone" encompassing the airport where leaders will arrive and the conference centre where they will meet.

The group is calling for residents who live within the security zone to hang flags and banners out of their windows so the world leaders will see them on the way in.

"Greenpeace stands for nonviolent direct action - we have peace in our name - and it would be a shame if violence moved the message away from what the G20 should be doing on climate and other issues," Morgan said.

OPINION: Are protests enough to bring down the G20?

German Chancellor Angela Merkel has told community organisers in Hamburg that she understood the importance of demonstrations to express criticism and concerns, but urged them to remain non-violent.

"It should be peaceful criticism," she said in June.

Still, German security officials are preparing for the worst, drawing upon decades of experience dealing with May Day demonstrations and other protests at major events, including the G7 in 2015 and G8 in 2007.

Germany has also denied Turkey's President Recep Tayyip Erdogan permission to hold a public rally on the sidelines of the summit, which could have drawn huge protests from Kurds living in Germany.