Vienna’s recent city elections are the latest signal of the Europeans’ growing hostility to refugees and immigrants. As many countries on the continent struggle to accommodate the growing number of refugees, it’s important to emphasize that many of the difficulties are caused by Europe’s own economic policies rather than something inherent in the migrants.

Heinz—Christian Srache, the far—right candidate who advocates building a fortified wall along Austria’s border to keep refugees out, lost the Vienna election, but his anti—immigrant stance won him a record share of the vote in a city that has been governed by social democrats since the end of World War II.

Austria is not alone. Protesters in Dresden, Germany, recently carried gallows for Chancellor Angela Merkel in opposition to her advocacy on behalf of allowing hundreds of thousands of Syrian refugees into Europe. Last month in the European parliament, Geert Wilders called the refugees an “Islamic asylum tsunami” and claimed that they are “testosterone bombs” who “threaten our girls.”

There are natural reasons European countries, with their more ethnically homogeneous populations and longer cultural histories, may have a harder time integrating large numbers of poor, and often Islamic, immigrants than the United States. But much of their troubles are due to their own poor labor—market policies.

European labor markets are highly regulated, making it difficult for immigrants to find jobs. As the Fraser Institute’s Economic Freedom of the World Annual Report notes, bureaucratic labor—market interference includes hiring—and—firing regulations, a high minimum—wage relative to productivity, centralized collective bargaining, and working—hours regulations.

European Union countries average a score of only 5.97 out of a possible 10 in labor—market freedom, the Fraser report shows. The United States, by comparison, scores 48 percent higher with 8.83. In fact, if European countries repressed economic freedom this dramatically in other areas, they would be among some of the least economically free countries in the world.

Worker—dismissal regulations are particularly draconian. If the same dismissal laws were applied to dating, they would amount to requiring a promise to marry, with no possibility of divorce, before ever going on a first date. Under such a regime, there would be few first dates. Furthermore, only people who already knew one another well would have any shot at a date. A similar effect is evident in labor markets.

High minimum wages prevent low—skilled workers from entering the labor force. Relative to average productivity, the minimum wage in the United Kingdom is nearly twice as high as in the United States. The French minimum is nearly 50 percent higher than the U.S. level.

These laws disproportionately prevent immigrants from finding jobs. Immigrants and refugees are disproportionately low—skilled, so high minimum wages exclude them from the labor market to a greater extent than they do the native—born population. Similarly, since they are unproven and unknown, and dismissing them would be so hard, they are less likely to be hired.

As a result, fewer than half of Europe’s foreign—born non—EU citizens aged 15 and over have jobs. In the United States, where labor markets are less regulated, the foreign—worker participation rate is 25 percent higher.

Immigrants often enclave and organize to demand subsidies from the government when they cannot earn livings by entering the workforce. Native—born citizens, often justly, resent these immigrant demands. As a result, hard—right anti—immigrant political parties gain appeal.

Not all of Europe’s problems integrating immigrants and refugees stem from draconian labor—market restrictions, but they do play a major role. Ironically, if the social democrats in Europe want to remain competitive in elections, they need to abandon their favored labor—market regulations and liberalize in order to minimize the appeal of the hard right.