In the midst of a row over Madrid's hospitalization of a Western Sahara independence activist, Morocco attempted to justify its passive approach to border control at Spain's tiny north African enclave of Ceuta.
After a reported 8,000 migrants arrived in Ceuta from Morocco on Monday and Tuesday, Spanish troops were sent to the border.
President Juan Jesus Vivas of Ceuta has accused Morocco of failing to do enough to stop the influx, while Prime Minister Pedro Sanchez of Spain has described the crossings as "an act of defiance."
“Morocco's lack of border protection is a show of disdain for the European Union, not for Spain,” he told the Spanish Parliament.
After Brahim Ghali, the ailing Western Sahara official was admitted to a Spanish hospital, Morocco's Minister for Human Rights, El Mustapha Ramid, appeared to explain the country's approach.
He wrote on Facebook, "What did Spain expect from Morocco, which is hosting the leader of a party that has taken up arms against the kingdom?"
"Morocco has the right to lean back and spread its legs... so that Spain understands how expensive it is to underestimate Morocco."
Approximately 4,800 migrants were returned from Ceuta, with Moroccan security forces intervening to stop further crossings.
"Those who entered irregularly are being handed over immediately," Mr Sanchez said.
Spain has received assistance from senior European officials.
On Wednesday, European Commission Vice President Margaritis Schinas said that the continent "will not be bullied by anyone."
“Cooperation, confidence, and mutual commitments should be the principles of a close relationship between the European Union and Morocco,” said European Council President Charles Michel.
Ylva Johansson, the EU's home affairs manager, said the influx was concerning.
“What matters now is that Morocco remains committed to preventing irregular departures and that those who do not have the right to stay are returned in a timely and successful manner,” she told the European Parliament.
“Borders in Spain are European borders. Morocco and the European Union want to establish a partnership based on mutual confidence and joint commitments. “Migration is a crucial component.”