Supporters and opponents of a group campaigning against what it sees as the "Islamisation" of Europe have held rival rallies across Germany.
There have been weekly protests by the Patriotic Europeans against the Islamisation of the West (Pegida) since October.
A record 18,000 people turned out on Monday at one rally in Dresden.
But counter demonstrations have sprung up and the group has been condemned by senior German politicians.
Thousands of people marched in Berlin, Cologne, Dresden and Stuttgart.
In Berlin, police said that some 5,000 counter-demonstrators blocked hundreds of Pegida supporters from marching along their planned route.
A total of 22,000 anti-Pegida demonstrators rallied in Stuttgart, Muenster and Hamburg, according to the DPS news agency.
But in Dresden, police said that 18,000 people turned up for just one anti-immigration rally. The counter-demonstration attracted 3,000 people.
In Cologne, the authorities switched off the lights of the city's cathedral as a way of warning Pegida supporters they were supporting "extremists".
"We don't think of it as a protest, but we would like to make the many conservative Christians [who support Pegida] think about what they are doing," the dean of the cathedral, Norbert Feldhoff, told the BBC.
Only about 250 Pegida supporters showed up in Cologne, compared to thousands of counter-demonstrators.
Much of the city centre was also plunged into darkness as lights were switched off at major buildings and bridges across the Rhine, according to the news agency DPA.
"Today, there is really a democratic sign being sent and a lot of people in Cologne are expressing their opinion," said Cologne mayor Juergen Roters.
"They want to stress that we here in Cologne do not want to have anything to do with right-wing extremists and xenophobic people."
In Dresden, carmaker Volkswagen said it was also keeping its manufacturing plant dark to show that the company "stands for an open, free and democratic society."
German Chancellor Angela Merkel attacked the movement in her new year speech, saying its leaders have "prejudice, coldness, even hatred in their hearts".
Kathrin Oertel, one of the main organisers of Pegida, responded in a speech at the rally in Dresden. She said that there was "political repression" in Germany once again.
"Or how would you see it when we are insulted or called racists or Nazis openly by all the political mainstream parties and media for our justified criticism of Germany's asylum seeker policies and the non-existent immigration policy?"
What is Pegida?
- Founded in Dresden by activist Lutz Bachmann in October 2014
- Acronym for Patriotische Europaer Gegen die Islamisierung des Abendlandes (Patriotic Europeans Against the Islamisation of the West)
- Umbrella group for German right-wing, attracting support from mainstream conservatives to neo-Nazi factions and football hooligans
- Holds street protests against what it sees as a dangerous rise in the influence of Islam over European countries
- Claims not to be racist or xenophobic
- 19-point manifesto says the movement opposes extremism and calls for protection of Germany's Judeo-Christian culture
German journalist Sigrun Rottman told the BBC that Pegida protesters were mixed but that the marches did include right-wing and racist groups.
She said it was important to note that Dresden, compared to other German cities, had very few immigrants, and even fewer Muslim residents.
Many supporters there felt "hard done-by" and unrepresented by mainstream politics and media, she added.
Opponents of Pegida, in particular, used social media to voice their disapproval. The hashtag #nokoegida - referring to the protests in Cologne - was trending on Twitter in Germany on Tuesday.
"Seems like Germany is showing Europe how to quash a xenophobic movement tonight," journalist Nicolas Kayser-Bril tweeted.
A poll of just over 1,000 people carried out by Germany's Stern magazine found one in eight Germans would join an anti-Islam march if Pegida organised one near their home.
Germany receives more refugees and asylum seekers than any other EU country. Many of those have come from war-torn Syria.