Spain has installed a 1,600-ft barrier on the sea border between its North African territory of Ceuta and neighbouring Morocco after tens of thousands of migrants breached the frontier earlier in the week.

At least 67 migrants died, including some who drowned and others who were killed in a stampede to cross a breakwater barrier, the Spanish government said on Saturday.

Spanish Prime Minister Pedro Sanchez criticised the reaction of some other European Union leaders to the events in Ceuta, saying calls for Spain to be suspended from the EU’s borderless Schengen zone were “driven by prejudice, fake news, ignorance, or political interest”.

A handful of exhausted migrants who swam to Ceuta’s urban Tarajal beach on Saturday morning were met by soldiers who escorted them across the border. Most of the 50,000 to 60,000 migrants who entered the territory between Thursday and Friday soon went back.

“We are relentless against those who break the law,” Spanish interior minister Fernando Grande-Marlaska told journalists on Saturday.

Questioned how the massive border breach could have happened given the heavy security on both sides of the border and whether Morocco posed a threat to Ceuta, Mr Marlaska defended the government in Rabat.

“The events require an evaluation by Spain and Morocco,” he said. But it was the co-operation with its neighbours that allowed Spain “to revert the situation in 24 hours”.

“Morocco is not a threat to Ceuta, or to the rest of Spain. It is a reliable partner,” Mr Marlaska emphasised.

The leaders of 22 EU countries called for a co-ordinated response to the situation. In a letter to top EU officials, released on Saturday by the Danish prime minister’s office, the countries asked the EU’s current Irish presidency to urgently convene a videoconference of interior ministers.

“We cannot allow uncontrolled mass crossings, the instrumentalisation of migration or other hybrid threats to create the perception that illegal entry into the European Union is possible. That a migrant’s illegal entry can turn into legal stay,” the letter said. “Such a perception would encourage further attempts, undermine confidence in our common migration policy and have repercussions for all member states.”

Leaders of Italy, Denmark, Austria, Belgium, Bulgaria, Cyprus, Croatia, the Czech Republic, Estonia, Finland, Germany, Greece, Hungary, Latvia, Lithuania, Malta, the Netherlands, Poland, Romania, Slovenia, Slovakia and Sweden signed the letter.

Mr Sanchez also asked for a videoconference of EU interior ministers to “enable us to establish a common response to situations of this kind and reaffirm that the security of our external borders is a shared responsibility of all member states, and not only of those on the union’s front line”.

Italian premier Giorgia Meloni has threatened to suspend Italy’s open-border Schengen agreement with Spain, and Italy was reimposing border controls for people arriving from Spain by air and sea.

“In the current international context, the European Union cannot afford this kind of selfish, polarising and unlawful reaction,” Mr Sanchez wrote in his letter.

Hundreds of migrants who recently crossed from Morocco into the Spanish enclave of Ceuta went back across the border on Saturday. They told an Associated Press reporter they were returning “of their own free will” after what they described as degrading treatment on the Spanish side.

Migrants walked along a long stretch of wave breakers before slipping into Morocco through a small breach in the border fence that had become an informal entry point. Moroccan police and soldiers stood by, watching. Most of the migrants were Moroccans, while a smaller number were from sub-Saharan Africa.