Not all of the comments were negative, and some users drew a parallel between the online uproar over the image of the young Muslim and the entry of the far-right Freedom Party into the country’s new right-leaning government, sworn in weeks before her birth. Both the Freedom Party and the conservative People’s Party of Chancellor Sebastian Kurz campaigned on anti-immigrant platforms, and the new government has vowed to cut monetary benefits to refugees and curb illegal immigration.

Nevertheless, Mr. Schwertner sought to turn the sentiment around, calling on his followers to stand up for the young family in an outpouring of social media support. By Thursday, more than 10,000 people had shared his message and more than 17,000 people posted hearts, along with words of congratulations, support and encouragement.

“Welcome to the world little one. May your life be blessed with love and peace,” Liesbeth Halbertsma wrote on Facebook. “I know it doesn’t always look like that in the world ... but there is so much beauty and love. Sending you much love.”

Barbara Unterlechner, the director of a center that provides legal counseling and support, #GegenHassimNetz, or “Against Online Hate,” said that since the arrival of hundreds of thousands of migrants seeking asylum two years ago, Austria had seen a rise in racist commentary and hate speech on the internet. More than 145,000 people, many from Syria, Iraq and Afghanistan, have applied for asylum in Austria since 2015, according to government figures.

“A certain stereotype about Muslims has become increasingly common on social media,” Ms. Unterlechner said in a telephone interview from Vienna. “Whether refugees or those wearing head scarves, there is no differentiation, but anyone appearing to be Muslim is cast as an enemy of our culture.”

It was not yet clear whether any of the comments would lead to legal complaints, Ms. Unterlechner said. But she was encouraged by how many people had responded to Mr. Schwertner’s call for support, given how challenging it could be for prosecutors to follow up on a wave of hate postings.

“Hate speech is ultimately a social problem, which can’t always be solved by the law,” Ms. Unterlechner said. “So it can be helpful to change the direction of the conversation online.”