Chancellor Angela Merkel urged Germans to turn their backs on a growing grassroots movement of anti-Muslim protesters, calling them racists full of hatred, and said Europe's biggest economy must welcome people fleeing conflict and war.
In an unusually strongly worded New Year address that also condemned Russia for its actions in Ukraine, Merkel said it was essential for Germany to help the children of persecuted people to grow up without fear.
Many Germans are worried about a flood of asylum-seekers, many from Syria, pouring into the country. A new movement, Patriotic Europeans Against the Islamization of the West (PEGIDA), is holding weekly rallies in the eastern city of Dresden.
Referring to protests that took place before the fall of the Berlin Wall, Merkel said, "Today many people are again shouting on Mondays: 'We are the people.' But in fact they mean: You do not belong — because of the color of your skin or your religion.
"So I say to everyone who goes to such demonstrations: Do not follow those who are appealing to you! Because too often there is prejudice, coldness, even hatred, in their hearts."
Partly in response to its Nazi past, German asylum rules are among the most liberal in the world. Asylum granted elsewhere had helped many opponents of the Nazi regime to survive.
The number of asylum-seekers arriving in Germany has surged to about 200,000 this year, four times the number in 2012. Net immigration has hit a two-decade high.
Consequently, immigration has moved up on the political agenda. Some members of Merkel's conservative bloc worry that they risk losing support if they do not respond to voter fears.
Growing support for PEGIDA's marches — a week ago more than 17,000 attended — and the popularity of the Alternative for Germany party since it shifted its focus from euro scepticism to immigration are causing shock waves in Berlin.
Merkel, who grew up in East Germany, also reiterated that Russia had questioned the foundation of Europe's peaceful order — self-determination — with its actions in Ukraine. She said Europe would not allow Russia to abuse human rights.