In its chaos, desperation and sheer scale, the sudden surge this week of tens of thousands of migrants into a Spanish territory in North Africa recalled similar scenes 11 years ago along the coasts of Greece and Italy.

It was that 2015 crisis — when more than a million people, mostly from the Middle East, swept into southern Europe — that deepened opposition to immigration across Europe and emboldened the far right.

Now as then, far-right leaders have tried to exploit scenes of border chaos on the doorstep of Europe. In Britain, France and Italy, anti-immigrant politicians warned that the latest crisis was stark proof of the dangers of Spain’s immigration policies, which are more liberal than those of many of its European neighbors.

The difference is that these far-right parties, largely marginal in 2015, are now either in power or have a plausible path to it. And Europe’s centrist leaders, desperate to avoid a political backlash, have adopted some of their hard-line policies and language on immigration, abandoning the more welcoming approach of 2015. In little more than a decade, the far right has largely reshaped the immigration narrative.

“If centrist leaders give the impression that they are being outflanked on these issues, they will lose the narrative completely,” said François Gemenne, an expert on migration and climate issues at HEC Paris, a business school. “That’s why they feel obliged to show themselves as very tough on issues like border control.”

Centrist leaders from Denmark to France quickly condemned the influx to Ceuta, the Spanish territory whose borders were overwhelmed on Thursday. They vowed to fortify their own frontiers to block the migrants, even though most of the new arrivals had turned around and crossed back into Morocco within hours.