The Spanish prime minister condemned last week's crossing from Morocco, which led to the deaths of 23 migrants, as "an attack on Spain's borders".
Some 65 migrants, mostly Sudanese, are to be prosecuted in Morocco for taking part in a deadly attempt to force their way into the Spanish enclave of Melilla from Morocco last week, according to a defence lawyer.
Meanwhile, the Spanish prime minister has condemned the attempted crossing in which at least 23 people died as “an attack on Spain's borders”.
Pedro Sánchez defended the way Moroccan and Spanish police repelled the migrants. “We must remember that many of these migrants attacked Spain’s borders with axes and hooks,” he told The Associated Press.
“We are talking about an attempt to assault the fence that was evidently carried out in an aggressive way, and therefore what Spain’s state security forces and Moroccan guards did was defend Spain’s borders.”
Authorities said around 2,000 people attempted to breach the border on Friday, and the individuals died as a result of a “stampede” of people who attempted to climb an iron fence.
Videos and photos posted on social media appear to show the aftermath, with Moroccan police standing over scores of migrants, some of whom look injured.
Prosecutors in the northern city of Nador, which borders Melilla, have charged 37 migrants with "illegal entry into Morocco", "violence against law enforcement officers", "armed gathering" and "refusal to comply", their lawyer, Khalid Ameza, told AFP.
A second group, consisting of 28 migrants, will also be tried for "participation in a criminal gang with a view to organising and facilitating illegal immigration abroad", he added.
The lawyer said that the majority of the defendants were from Darfur, in western Sudan, which is in the grip of a serious food crisis and where recent violence has left more than 125 people dead and 50,000 displaced.
Others are from Chad and Mali, while one is Yemeni. A request for conditional release was refused, the lawyer said.
NGOs working in northern Africa and human rights organisations have deplored the treatment the migrants received from police on both sides. But they have also directed their blame at Spanish and European Union officials who they say have essentially outsourced border controls to Morocco and other states.
Sánchez blamed the tragedy on “international human trafficking rings who are profiting from the suffering of human beings who only want to seek a better life”.
“I insist, these are international mafia groups that are not only damaging the territorial integrity of Spain but also that of Morocco, which is a country suffering that irregular migration,” Spain's prime minister added.
The Spanish public prosecutor's office announced on Tuesday that it had also opened an investigation into the migrants' deaths.
"I am shocked by the violence on the Nador-Melilla border on Friday which resulted in the deaths of dozens of migrants and asylum seekers," said UN Secretary-General António Guterres
"The use of excessive force is unacceptable, and the human rights and dignity of people on the move must be prioritised by countries."