Anti-globalisation activists have rioted for a second night as Hamburg hosts the G20 leaders, setting up street barricades, looting supermarkets and attacking police with slingshots and petrol bombs.

Police said riots were extremely violent in the early hours of Saturday in the city's Schanzenviertel neighbourhood.

Hundreds of officers went into buildings to arrest rioters while being attacked with iron rods and Molotov cocktails thrown from the roofs.

Thirteen activists were arrested when special units stormed one building.

Sorry, this video has expired Protesters clash with police ahead of G20

Some 500 people looted a supermarket in the neighbourhood, as well as smaller stores. Cars were torched and street fires lit as activists built barricades with garbage cans and bikes.

Police said at least 196 officers were injured in the clashes, with 83 protesters temporarily detained at the scene and 19 taken into custody.

Meanwhile, activists from the environmental Greenpeace group scaled a bridge in Hamburg and unfurled a banner saying, "G-20: End Coal".

Germany's top security official denounced the rioting, saying that it is "the opposite of democratic protest".

Thirteen activists were arrested when special units stormed one building. ( Reuters: Kai Pfaffenbach )

After rioters set up street barricades, looted supermarkets and attacked police with slingshots, Interior Minister Thomas de Maiziere said: "These were unbounded violent excesses out of a desire for destruction and brutality".

"Completely uninhibited attacks against people and objects, looting and arson by anarchists from Germany and Europe, have nothing to do with political motives or protest."

Mr de Maiziere said police and judicial authorities must take a tough stance against such crimes, and it was good arrests were made.

Greenpeace activists demand international G20 leaders to phase out coal and speed up global climate action. ( Reuters: Fabian Bimmer )

In a statement, the group said 65 activists participated in the protest early on Saturday, demanding international G20 leaders act quickly to phase out coal and speed up global climate action.

Fighting global warming is one of the major issues on the G20 agenda, but negotiations are proving to be difficult since the US left the international Paris climate agreement a few weeks ago.

World leaders will come together later on Saturday to tackle issues including terrorism, climate change and trade.

Cars were torched and street fires lit as activists built barricades with garbage cans and bikes. ( Reuters: Hannibal Hanschke )

AP