The shocking mass sexual assaults against women in Cologne, Germany, on New Year's Eve have provoked public fury, including a backlash against Chancellor Angela Merkel's policy of welcoming asylum-seekers, who were among the suspects identified by authorities. To protect women and to ensure that Europe can maintain the political will to absorb millions of refugees fleeing war and deprivation, the continent will have to face this problem head-on.

More than 500 complaints have been filed with the Cologne police, most for sexual assault. Similar New Year's attacks occurred in Hamburg and Stuttgart. And the problem is not limited to Germany: The Swedish police are investigating a possible coverup of assaults by migrant men at a festival last August.

Woefully ineffective policing is certainly to blame in Cologne — and must be improved — and Germany must also act swiftly against anyone convicted. The news that Merkel's government is proposing changes to the law so foreigners guilty of sexual and other physical assaults can be deported will send a strong message that such crimes will not be tolerated.

Europe also must find a way to cope with a problem that has been largely ignored until now: sexual aggression by refugees from countries where women do not have the same freedoms as in Europe. Female refugees are often the first victims, reporting high levels of sexual abuse and violence, including being forced to "pay" smugglers with sex. They also report being abused by the police and other European men. More resources are needed to keep these women safe.

A broader challenge is how to acculturate large numbers of mostly young, Muslim men to the sexual and gender norms of Europe. Norway has embarked on a nationwide program to help arriving men understand — and respect — European norms. That program should be an inspiration for Germany and other countries.

But these men must not be stigmatized. As Federica Mogherini, the European Union's representative for foreign affairs and security policy, rightly observed, "Unfortunately, violence against women is something that existed before the events that we faced on Dec. 31."

On Monday, Pope Francis urged Europe to "find the right balance between its twofold moral responsibility to protect the rights of its citizens and to ensure assistance and acceptance to migrants." For Europe to succeed in its great experiment with the largest influx of people since World War II, respect for the safety and freedom of women must be at the heart of the effort.

FROM AN EDITORIAL IN THE NEW YORK TIMES