LONDON - Over the past few years, European governments have congratulated themselves for stemming illegal migration along some of the key routes for refugees entering their continent.
An agreement with Turkey concluded in 2016 provides cash in return for a Turkish undertaking to intercept and hold refugees from the Middle East in camps outside Europe's borders.
Intensified maritime patrols in the Mediterranean Sea and bilateral arrangements with various militias in war-torn Libya and with the government of Tunisia have reduced illegal migration into Europe via Italy.
But it seems that European capitals have rejoiced too soon.
Preliminary figures of new asylum seekers this year indicate that the flow into the continent has simply shifted to another vulnerable European entry point: Spain.
In the first six months of this year (2018), about 15,000 new asylum seekers were registered in Greece, the first port of call for those coming through Turkey, and a further 18,000 landed in Italy.
But the number of arrivals in Spain stands at 24,000 for the first half of this year. And the pressure is building up fast: 1,200 migrants were admitted after just two ship rescues last week, while striking images of African migrants landing on Spain's beaches under the stunned gazes of tourists are now a daily occurrence.
This rapidly-shifting pattern is a good indication that much of the unregulated or illegal migration flow into Europe is not prompted by immediate conflict around the continent's edges, but is largely dominated by people smugglers who are very well attuned to Europe's shifting political trends and opportunities.
The recent formation of a far-right government in Italy determined to close the borders to new migrants coincided with a change of government in Spain, where centre-left leaders displayed a more welcoming attitude.
A few days after taking office in late May, Spanish Prime Minister Pedro Sánchez unveiled a new "humane refugee policy" by permitting the landing of rescue ship Aquarius, which picked up 600 asylum seekers from Sudan and Bangladesh but was barred from entry into Italy.
Spanish Interior Minister Fernando Grande-Marlaska also announced that he intends to dismantle the razor-sharp blades at the fences at some of Spain's borders.
It did not take long for people-smuggling criminal gangs to work out that Spain is now Europe's "soft spot".
The number of refugee arrivals on Spain's territory is currently running at more than three times the levels in the comparable period last year.
Quite apart from the strain on Spanish social services, the political dilemmas facing Spain's new leaders are acute.
Many of the migrants come either through the Straits of Gibraltar, the shortest stretch of sea separating Spain from Morocco, or by climbing the fences around Ceuta and Melilla, two Spanish enclaves in north Africa surrounded by Moroccan territory.
Stemming the human flow through Gibraltar's waters would require Spain to cooperate with Britain, which controls the territory. But that will not be easy.
The Spanish, who claim Gibraltar as their own land, dismiss Britain's presence as a "colonial vestige" and are determined to press the British hard about the status of the territory, especially since the United Kingdom is now leaving the European Union.
Strangely, however, Spain refuses to recognise that its own two enclaves in Morocco, which are claimed by the Moroccans, represent a comparable colonial problem to that of Britain's Gibraltar, or may require a similar solution.
So, while these historic disputes do not necessarily prevent Spain from negotiating with Britain and Morocco over refugee pressures, all governments in the negotiations remain acutely aware that what is at stake is not only a matter of regulating migratory flows, but also that of establishing or amending legal precedents over territorial possessions, a far trickier task.
For now, the Spanish government is trying to present the problem as a Europe-wide challenge.
"Let us not delude ourselves; if the passage through the central Mediterranean is closed, the flow of migration does not dry up in the countries of origin," argues Spanish Foreign Minister Josep Borrell.
He is calling on Europe not to abandon the southern countries of the continent to deal with the problem alone. "Ours is the frontier of all," he has said.
French President Emmanuel Macron, who visited Spain last week, is keen to help. He has signed a joint appeal with Spanish Premier Pedro Sánchez, affirming the urgency of "building a model of migration based on solidarity and respect for human rights" in Europe. France has also offered to admit some of the refugees from the Aquarius ship which landed in Spain.
But Spain's ruling Socialists know that they would lose the next elections if they do not curb this migration fast.
And since they have no parliamentary majority, elections may not be that far off.