About 300 Africans who fled the 2011 conflict in Libya are now stranded in the northern German city of Hamburg, where many of them are sleeping rough.
Angry German officials allege that Italy - where the Africans first arrived - gave them some cash and visas so that they could move on to Germany.
The Hamburg authorities say they are struggling to find shelter for the men and women from Libya, Ghana and Togo.
Many African refugees fled to Italy in small, overcrowded boats in 2011.
The Hamburg senator for social and family welfare issues, Detlef Scheele, said "we're trying to establish currently how the ones whose visas have expired can be sent back to Italy", German media reported.
Mr Scheele, a Social Democrat (SPD) politician, said "it would be irresponsible to arouse false expectations; a return trip is the only option".
He said the Africans had no right to seek work or social welfare in Germany.
Struggle for shelter
Last week the refugees staged a demonstration outside Hamburg city hall with a banner that read: "We didn't survive Nato war in Libya to die in the streets of Hamburg".
The Hamburger Abendblatt newspaper reports that the welfare authorities and church groups are working together to help the Africans, many of whom are sleeping on the port city's streets, on park benches or under trees.
But the city's homeless shelters are full and Mr Scheele has refused to erect temporary tents for the Africans, the newspaper reports.
According to a German interior ministry message, quoted by German media, they were given up to 500 euros (£428; $647) each in Italy to persuade them to leave the country, as well as Schengen zone visas enabling them to travel to other EU countries.
A German lower house (Bundestag) MP, Johannes Kahrs of the SPD, described Italy's actions as "incomprehensible". "I don't know what legal basis the Italians are using for doing this," he said.
Under EU rules, the country where refugees first arrive in the EU is supposed to look after them and process their asylum applications.