BERLIN — Even at its most fractious, Europe has always managed to find common ground, if not unity, in the Continent’s favorite pastime — football.

Or so we thought.

In a sign of the degree to which the rise of right-wing populism is poisoning the region’s political debate, undermining its mainstream parties and splitting its traditional alliances, even star soccer players now find themselves caught up in Europe’s identity wars.

The run-up to next week’s start of the European football championship has seen a leader of Germany’s anti-immigrant Alternative for Germany (AfD) party telling an interviewer that while most Germans admired the skills of national team defender Jérôme Boateng, “they don’t want a Boateng as their neighbor.”

Boateng, born and raised in Germany, is black. Other AfD politicians took issue with star German striker Mesut Özil, who is of Turkish descent, for posting a photograph of himself during a pilgrimage to Mecca on Facebook. The photo, which received more than 2 million comments, sent an “anti-patriotic signal,” said Andrea Kersten, an AfD official in Saxony.

The comments come as members of the far-right Pegida organization complained over a chocolate company’s decision to put childhood photos of the national players, several of whom have non-German roots, on special-edition packaging for Euro 2016.

The established parties all assailed the AfD’s blunt racism. Yet the episodes, which received wide coverage in the German media, reflect the persistent inflammability of the politics around migration in core European countries — even though the flow of refugees has all but come to a halt. As Germany and its neighbors struggle to cope with the challenges of integrating the refugees already there, incumbent governments find themselves under constant assault from the right wing. So far, the mainstream parties appear to be losing the battle.

Even as Europe’s centrist forces hailed the defeat of Austria's right-wing in the country’s presidential runoff last month as a triumph of reason over fear, they seemed unsure whether the result should be seen as a victory (after all, the right-wing candidate won 50 percent of the vote), much less what lessons should be drawn from the Austrian example.

“A weight has been lifted from Europe,” German Foreign Minister Frank-Walter Steinmeier declared.

After past near-misses with right-wing parties, the Continent’s mainstream lulled itself into a false sense of security.

“Relieved to see the Austrians reject populism and extremism,” French Prime Minister Manuel Valls tweeted. “Everyone must draw the lessons in Europe.”

But will they?

Nativist rhetoric

After past near-misses with right-wing parties, the Continent’s mainstream lulled itself into a false sense of security. That could be dangerous this time as major battles loom against populists with the upcoming Brexit referendum, followed by elections in France and Germany in 2017.

The risk isn’t contagion. There is no evidence that the success of a far-right party in one European state bolsters similar movements in neighboring countries. Politics in Europe remains intensely local.

Rather the issue is that the core cultural themes that propelled the Freedom Party’s surge — in particular concern over migration and the influence of Islam — resonate in other corners of prosperous Western Europe as well. Whether in the Netherlands, France, Germany or the U.K., it is ultimately identity politics that drives voters into the arms of populists.

For the most part, Europe’s establishment parties, both to the Right and Left of center, have struggled to counter the nativist, Euroskeptic rhetoric.

It’s unlikely to get any easier. With the migrant issue still unresolved and frustration over the EU growing, populists often have to do little but sit back and watch their poll numbers rise.

News this week that net migration to the U.K. last year rose to 330,000, the second highest level on record despite a government pledge to reduce the numbers, illustrates the challenge.

Even though the German government has succeeded in stanching the flow of refugees to the country, fears over the consequences of taking in more than one million migrants last year persist.

The AfD has been fairly steady at about 15 percent in polls for the past couple of months. While that may not sound like much, the party — barely three years old — is now the third most popular in Germany, just four percentage points behind the Social Democrats, who have slumped to historic lows. The governing “grand coaltion” between Merkel’s conservatives and the Social Democrats has fallen below 50 percent for the first time, according to a poll published this week by the Bild newspaper.

In France, Marine Le Pen’s National Front leads in the polls, as does Geert Wilders’ Party for Freedom in the Netherlands.

Backfired

The Continent’s governing parties are divided over how to confront the challenge. For a time, Merkel’s Christian Democrats refused to even acknowledge the existence of the AfD. Since the party’s impressive showing in regional elections a few months ago, the Christian Democrats, most at risk of losing supporters to the AfD, have taken a more aggressive approach. Their Bavarian sister party, the Christian Social Union, wants Merkel to go even further by effectively sealing Germany’s borders to refugees and taking a harder line on the migrants already here.

A months-long dispute between Merkel and Bavarian state premier Horst Seehofer has intensified to such a degree that some party faithful fear a break-up of the decades-old alliance, known in Germany simply as “the Union.”

Behind those tensions lies a fundamental disadvantage common to all mainstream parties: They weren’t built to deal with populists.

“It will take far more strategic reflection and unpleasant farewells to cherished ideals before establishment parties in Europe are fully capable of dealing with populists,” said Timo Lochocki, an analyst with the German Marshall Fund in Berlin and an expert on Europe’s far-right movements.

In other words, establishment parties don’t generally pursue the quick-fix solutions demanded by the far right. Indeed, their policy prescriptions, enshrined in party programs after lengthy debate, can take years to bear fruit.

With elections in both France and Germany slated for next year, the incumbent parties have few policy levers to pull. What’s more, co-opting the far-right’s playbook can backfire, as former Austrian Chancellor Werner Faymann discovered the hard way.

With popular support for his government plummeting amid the refugee crisis, Faymann reversed course, reinforced Austria’s borders and vowed to limit the number of refugees the country would take, all positions long advocated by the Freedom Party.

Voters gave the far-right credit for the shift. Following the Freedom Party’s first-place finish in the first round of presidential elections, Faymann resigned.

“If you adopt the policies of the right wing, you’re not gaining anyone,” said Eugen Freund, a Social Democrat MEP from Austria.

Don’t side with populists

Critics accuse Merkel’s government, with its recent “integration law,” of doing just that. Under the legislation, refugees are no longer permitted to choose where they want to live. They are also obligated to take German lessons and attend “orientation courses” designed to teach them local values and customs. The new law is the just the latest of a series of measures undertaken by the government last fall aimed at tightening Germany’s rules for refugees.

So far, the strategy has done nothing to stop the government’s slide in the polls.

The election outcome in Austria, a country long plagued by anti-immigrant, far-right parties, has convinced many in Europe’s political establishment that they will ultimately prevail.

Speaking at celebrations of the 40th anniversary of the center-right European People’s Party in Luxembourg this week, Commission President Jean-Claude Juncker added his voice to the chorus of those warning about the pull of populism.

“We must stick to the principle of not sliding into the camp of populists,” said Juncker, who made a rare intervention in the Austrian presidential election by endorsing the Greens’ Alexander Van der Bellen, who eventually won at the second round. “There must be a clear division between the EPP and the extreme-right in the European Union and on the Continent, and that has to be constantly made clear.”

That Hungarian leader and EPP member Viktor Orbán, a man Juncker once referred to as “the dictator,” was sitting in the audience illustrated just how close the populist threat lies.

Nonetheless, the election outcome in Austria, a country long plagued by anti-immigrant, far-right parties, has convinced many in Europe’s political establishment that they will ultimately prevail.

Freund, the Austrian MEP, says colleagues from both his own Social Democrat party as well as the EPP continue to congratulate him for the defeat of Freedom Party candidate Norbert Hofer in the presidential runoff.

“Everyone worried it would open the door to anti-European movements in other countries,” he said. “But Hofer didn’t get the job. He’s not there.”