Some 850 people took part in two demonstrations on Saturday in the northern German city of Hamburg ahead of a Group of 20 summit taking place there next month.
Some 650 people gathered at Hamburg's main train station to protest the deportation of failed asylum seekers, police said, with demonstrators holding banners reading "stop the deportations" and "no human is illegal."
The protesters included asylum seekers from countries including Sudan, Afghanistan, Syria and Eritrea.
Separately, some 200 people gathered in Hamburg's southern Harburg district outside a venue that the police has turned into a mass detention center in anticipation of the G20 protests.
The 11,000-square-meter center has 70 group cells and 50 single cells that can hold as many as 400 detainees.
Saturday's rallies marked the first protests against the G20 summit, which takes place on July 7 and 8.