A crowd gathers outside the main train station in Cologne, Germany, on New Year's Eve.EPA

In the wake of horrifying tales of sexual assault perpetrated by potentially up to 1,000 men on New Year’s Eve, German officials have made two stunning decisions.

The first, from Cologne, Germany — where the attacks took place — was Mayor Henriette Reker telling women to adopt a “code of conduct” to prevent further sexual assaults, which crossed the line into “victim blaming.”

The second, from the broader German government, was to crack down hard — not on those responsible for the assaults, but for those criticizing the Muslim immigrants who may have perpetrated them.

Let’s take a step back and remember how all of this started. On New Year’s Eve, women celebrating in Cologne were reportedly groped, sexually assaulted and/or robbed as they walked the streets.

More than 100 criminal complaints have been filed, 75 percent of which were reports of sexual assault. Two women reported being raped by the men, who were allegedly of North African and Arab appearance. Women in Hamburg and Stuttgart also reported similar attacks.

So far several dozen have been identified, most of whom were asylum seekers.

But due to Germany’s desperation to prove not only that it’s the most tolerant country in Europe but also that letting in hundreds of thousands of immigrants would have no disastrous consequences, the female victims of the attacks were initially ignored by the political class. Had the alleged perpetrators been white members of a fraternity, the international response would have been completely different, as the Atlantic’s David Frum noted.

Suddenly the presumption that accusers of sexual assault must be automatically believed has gone out the window, the latest victim of European “multiculturalism” and Western political correctness.

Gone, too, are the demands that women receive no crime-prevention tips, since that amounts to blaming the victim, instead insisting we “teach men not to rape.”

In the left’s pyramid of grievances, Islamophobia now outranks the war on women.

Many of the early reports ignored the question of the nationality of the alleged perpetrators altogether. Even the suggestion that the recent wave of immigrants from countries that view women as chattel rather than human beings led to the attacks had to be downplayed. Instead, women were told to take steps to prevent further assaults by adopting a “code of conduct.”

This “code” included the recommendation that women keep “an arm’s length” from strangers.

Now, crime-prevention tips are helpful and often obvious. Don’t walk down a dark alley alone at night. Be aware of your surroundings. These are commonsense and apply to nearly every crime.

But telling women to behave differently — even fearfully — in public places in the middle of the day does amount to victim-blaming. Why not just tell women to stay indoors or wear a burqa?

Furthermore, how would an arm’s distance stop someone intent on groping or sexually assaulting — especially if there were, as reported, 1,000 potential perpetrators?

In a just world, the blame would rest squarely on the men responsible — who currently appear to be of Arab and North African descent. It wasn’t until a week after the attacks that German Chancellor Angela Merkel finally agreed to changing the country’s immigration policies. This occurred after Cologne’s mayor victim-blamed the women, after the country cracked down on those criticizing the lax immigration policies and after protesters at an anti-immigration demonstration were pepper-sprayed. It appears Germany was more concerned with looking intolerant of asylum seekers than the well-being of female victims.

Perhaps countries accepting refugees should also adopt Norway’s approach and literally teach migrants not to rape, which officials are doing now for new immigrants. Because if there’s anywhere in the world with a rape culture, it’s in the Middle East and North Africa, where women are lesser citizens and even treated as property.

But pointing that out goes against the narrative — and, as we saw in Cologne, ignoring that reality leads to devastating consequences.

No, not all migrants are prone to violence and rape, and these attacks should in no way ignore or excuse the violence toward those seeking asylum. But instead of addressing the possibility that women have become victims due to these migrants, Germany has opted to crack down on anyone speaking ill of them — as if they, and not the women who were left battered and bruised just trying to celebrate the New Year, were the real victims.

Ashe Schow is a commentary writer for the Washington Examiner and a senior political columnist for the New York Observer.