Following legal action by rights campaigners a Spanish court on Monday suspended the repatriation to Morocco of a group of unaccompanied minors who crossed into the Spanish enclave of Ceuta in May.
Two human rights groups took legal action after Spain on Friday began sending back some 800 unaccompanied child migrants to Morocco in groups of 15.
The rights campaigners had asked a court in Ceuta to stop the deportation of 12 migrants who had sought their help to stay, reports AFP.
The migrant children were being deported to Morocco without having had access to a lawyer or the chance to make their arguments, said Patricia Fernandez Vicens, the lawyer for one of the rights groups, Coordinadora de Barrios.
The court in Ceuta agreed to hear the case and said "the only decision possible" was to order the suspension of the deportation of the 12 minors while it considers arguments.
The court ruling may make it difficult for Spain to go ahead with plans to repatriate the roughly 800 unaccompanied minors in their care. However, three of the migrants the activists were defending have already been sent back to Morocco.
The unaccompanied minors were among up to 10,000 migrants who crossed the land border into Ceuta over several days in May as Moroccan border guards stood aside.
On Saturday the General Prosecutor of the State in Spain on Saturday had opened an investigation into the return operations, news agency ANSA reported, citing Spanish daily ABC and EFE news agency.
The Madrid repatriation order was issued by the interior ministry and made known through the press on Sunday. It caused concern for the Spanish Ombudsman, who asked that the repatriations be halted, and angered several NGOs, which denounced the practice as illegal due to the fact that it would take place without sufficient legal protection.
Cadena Ser radio reported it had access to a document written by the prosecutor's office on Saturday, asking the government for detailed information on the individual cases of the minors for which repatriation is planned.
Criticism of the government
The decision to repatriate the minors also created discontent within the government itself. Spanish digital daily El Confidencial reported that Spanish Social Rights Minister Ione Belarra of the left-wing Unidas Podemos party sent a letter to the interior minister expressing doubts about the legality of the operation.
Ceuta authorities have said that only children considered non-vulnerable will be repatriated. The interior ministry's directive, made known on Friday exclusively by Cadena Ser radio, assured that the Moroccan government will take the minors into its care.
Madrid says Ceuta minor repatriations legal
Earlier Monday, Spanish Interior Minister Fernando Grande-Marlaska said repatriations to Morocco of minor migrants are legal "assisted repatriations" carried out to guarantee "the higher interest of the minor" following a "detailed" study on the personal situation of each.
Marlaska said the under-18 migrants sent back to Morocco are not in vulnerable situations and are young people without "social roots" in Spain and are therefore being returned to the custody of their families.
He did not specify, however, how many minors will be repatriated to Morocco because that is the job of the local Ceuta authorities who are responsible for establishing on a case-by-case basis who can be repatriated.
Minors tempted to flee to avoid repatriation
At the weekend, some minor migrants housed in a center set up by the Spanish authorities in Ceuta tried to flee to avoid being sent back to Morocco.
EFE said there was tension among the very young who are likely to be sent back to Morocco, as many do not want to return there, and on Saturday morning police had to intervene to maintain order. Spanish media said over 50 young people tried to escape and their whereabouts are currently unknown.
Reporting by ANSA, updated with AFP