The sudden influx of thousands of migrants into Spanish territory this week has created a new crisis on Europe’s southern border.
On Monday, an estimated 6,000 migrants crossed from Morocco to the Spanish city of Ceuta, on the north African coast. Many travelled the short distance by swimming around the border fence or drifting around it on rafts. However, others were able to get around the fence on foot, as Moroccan police appeared not to stop them.
Socialist prime minister Pedro Sánchez responded by deploying the army to Ceuta and reinforcing police controls along the border. He also cancelled a planned trip to Paris.
“The integrity of Ceuta, as part of our nation, the Spanish nation, its safety, and the peace of mind of our compatriots there are guaranteed by the Spanish government, whatever the conditions and resources that are required to ensure that,” said Mr Sánchez, before travelling to the city.
The majority of those who crossed the border were Moroccan, although there were also sub-Saharan Africans. According to reports, between 1,500 and 2,000 children were among those who crossed. One man died after trying to swim around the border fence.
Spain has two territories in north Africa, Ceuta and Melilla, which have the only land borders between Europe and the African continent. Both cities are used to receiving large numbers of migrants. However, this was the single biggest arrival of migrants to Spain in one day.
Meanwhile, in Melilla, several dozen migrants reached the city by scaling the fence surrounding it.
Monday's sudden influx has been widely attributed to diplomatic tensions between Madrid and Rabat. The Moroccan government recently reprimanded Mr Sánchez's administration for allowing the Western Saharan leader, Brahim Ghali, to be treated in a Spanish hospital, reportedly in Logroño, where he remains.
Mr Ghali is leader of the Polisario Front, which has fought for Western Saharan sovereignty against the claims of Morocco.
Earlier this month, Rabat publicly warned Madrid that the decision to receive the Polisario leader would have “consequences”, a promise which many believe was delivered on with the relaxing of controls by Moroccan border guards on Monday.
The Spanish government has refused to comment on any possible connection between Mr Ghali and the immigration crisis. However, Pablo Casado, leader of the opposition Popular Party (PP), said the situation was linked to a diplomatic crisis which the government had "ignored and hidden". He called on Mr Sánchez to "preserve our national sovereignty".
Santiago Abascal, leader of the far-right Vox party, wrote on Twitter that Morocco "is invading Ceuta with thousands of assailants".
On Tuesday, Spain’s interior ministry said that 2,700 of the new arrivals had been repatriated, apparently with the co-operation of Morocco. However, many migrants were still waiting near the border hoping to cross.
European Commission president Ursula von der Leyen was among the bloc’s leaders who expressed support for the Spanish government. She tweeted that the EU stood “in solidarity with Ceuta and Spain” and called for stronger relationships with countries like Morocco.