Twitter immediately took down the post, and suspended Ms. von Storch’s account for 12 hours. Ms. von Storch then posted on her Facebook page an image of Twitter’s message informing her of its actions. In the caption, she wished her more than 83,500 followers a “Happy New Year in a free country in which everyone can call barbarians barbarians, even if they are Muslims!”
Facebook later removed that post, Ms. von Storch told her followers. She vowed not to be silenced by the new law, but to continue to “call out problems by name.” She went on to insist that the young men who had sexually harassed German women were “not Protestant Swedes, not Catholic Poles, not Orthodox Russians, not Jewish Israelis and not Buddhist Thais. The overwhelming majority of them are young Muslim men for whom women and followers of other faiths are second-class citizens.”
Ms. von Storch, 46, was a member of the European Parliament until October, when she resigned after her election to the German Parliament. Her comments were particularly provocative because Cologne was the site of a rampage on New Year’s Eve 2015, in which hundreds of men groped, assaulted, harassed or robbed women. Many of the men were asylum-seekers or other immigrants, and the attacks on women fueled criticism by the Alternative for Germany, which argued that Ms. Merkel should not have opened Germany’s doors to so many foreigners.
The party ran on a platform arguing that Islam was incompatible with the German Constitution.
Ulf Willuhn, a spokesman for state prosecutors, said on Tuesday that his office had been alerted to Ms. von Storch’s statement by the Cologne police and was also looking into a statement of support for her, made by a leader of the party, Alice Weidel. As news of the investigation spread, private citizens filed dozens more complaints.
Unlike the United States, Germany has very strict laws governing hate speech and comments that denigrate ethnic and religious groups, a legacy of its dark, totalitarian past. The new law regarding social media companies solidified the country’s position as one of the most aggressive in moving against online hate speech.
Prosecutors must now decide whether there is sufficient evidence of criminal action to open a formal investigation that could lead to charges, Mr. Willuhn said. But before that step can be taken, Germany’s Parliament would have to lift immunity.
Many of the Alternative for Germany’s followers are active on social media, and the party claims nearly three times as many followers on Facebook than either of the country’s two largest parties, Ms. Merkel’s Christian Democrats or the center-left Social Democrats.
In a message posted to their party’s Twitter feed later Tuesday, the two lawmakers appeared with strips of red tape forming a cross over their lips beside the quote, “Exactly our humor: Call for freedom of speech in Iran and prevent it in Germany.”
Digital and human rights groups and others had warned that the new law — which was passed last year, but fully took effect on Monday — placed too much of the burden of patrolling the internet on companies such as Facebook, Twitter, Google and Snapchat. Under the law, the companies are required to to remove any content that is illegal in Germany — such as Nazi symbols or Holocaust denial, but also any remarks that could be considered calling for incitement — within 24 hours of it being brought to their attention.
Others have pointed out that the law could lead to mistakes, such as removing messages or videos in which the context is important. Last month, a member of Berlin’s Jewish community had posted a video of an anti-Semitic rant by a German man outside an Israeli restaurant, encouraging people to “pay attention, not look away” as part of efforts to raise awareness about a resurgence in anti-Semitism in the country.
Within 24 hours of its posting, Facebook had removed the video and closed the man’s account, citing its content. The company later restored the post and apologized for the error, but only after dozens of users had complained about the decision.