German police investigating a private Facebook group used to praise the Nazis have raided dozens of homes across the country.

The homes of 40 people were targeted in raids in 14 of the country's 16 states as the authorities sought people suspected of posting far-right or anti-Semitic material.

A unit to target the crimes was set up in 2015 after police in Bavaria spotted regular hate posts being published on a secret Facebook page, according to German website local.de.

German Chancellor Angela Merkel and Facebook's Mark Zuckerberg discussed the issue of hate speech in New York in September last year where she pressed the CEO about hate posts on his site

The issue came to the fore when Chancellor Angela Merkel was overheard challenging Facebook founder Mark Zuckerberg about the use of his social network to post racist comments in September last year.

Mr Zuckerberg was overheard saying: 'We need to do some work' about the problem during a conversation between the pair at a UN lunch.

German law restricts free speech if it includes incitement to violence, glorifying Nazism, racial discrimination and Holocaust denial. The raids are the latest step in a campaign targeting the rise in online hate speech, much of it posted anonymously.

Interior Minister Thomas de Maiziere said that the law must apply on the internet. 'Violent language is unacceptable and lays the groundwork for real violence,' he said.

His office said activists campaigning against far-right extremism are frequent targets of online hate speech.

Germans have become increasingly worried in the last year at the risk of political extremism, according to a new survey.

German Interior Minister Thomas de Maiziere welcomed raids and said violent language was unacceptable

Deadly terrorist attacks in neighbouring France and Belgium and concerns at more than a million migrants entering the country have fuelled those fears, said insurer R+V which carried out the survey.

Nearly three-quarters of Germans are concerned about terrorism, while political extremism is second on the list of worries for 68 percent of the population.

In January, Germany banned a far-right website for spreading 'racist, xenophobic, homophobic, anti-Semitic and anti-Islamic content' and arrested two site administrators.

Material linked to the Altermedia Deutschland platform included banned Nazi slogans and the denial of the Holocaust as well as incitement of violence against foreigners, prosecutors said.

Two months earlier, police raided homes in the German capital when officers confiscated smartphones and computers.

Officials said the it was part of an ongoing investigation into hate speech spread over social media meant to incite people against asylum-seekers and refugee housing.