Authorities in Germany are conducting raids against people suspected of posting hate messages on social media.

Federal police said authorities searched the homes of about 40 people, mostly on suspicion of posting far-right or anti-Semitic material.

German law restricts free speech if it includes incitement to violence, glorifying Nazism, racial discrimination or Holocaust denial.

Enforcement of the law has been tested in recent years by a rise in online hate speech, often posted anonymously.

Interior Minister Thomas de Maiziere said in a statement Wednesday that the law must apply on the internet too.

His office noted that activists who campaign against far-right extremism and migrants are particularly frequent targets of online hate speech.