The Spanish government estimates that about 10,000 minor migrants are living in Spain without their families — 70 percent of them from Morocco.
The issue was discussed during a bilateral meeting held in Essaouira on Morocco's Atlantic coast on Sept. 14, a spokesman for Spain's interior ministry said.
Spain's secretary of state for migration, Consuelo Rumi, "perceived a willingness" on the part of Morocco to repatriate unaccompanied minors living in Spain during the talks, the spokesman told French Press Agency (AFP).
"There is no concrete plan yet, this is part of negotiations, of a diplomatic process," he added.
The roughly 10,000 minor migrants in Spain are under the protection of the regions or cities where they arrive, mainly the southern region of Andalusia and the overseas territories of Ceuta and Melilla in northern Africa.
Spain's central government wants to incentivize other regions to take charge of some of them. Last month it unblocked 40 million euros ($46.5 million) for regions willing to welcome them.
There has been criticism of the way Spain welcomes unaccompanied foreign minors, particularly in Melilla, where many sleep in the streets or in caves waiting to smuggle themselves onto a boat to mainland Europe.
In Ceuta, local government spokesman Jacob Hachuel recently said the minors should be returned to Morocco, saying "they are better off in their family entourage."
Spain has become the biggest port of entry for clandestine migration into Europe after Italy largely closed its borders under pressure from far-right Interior Minister Matteo Salvini.
A total of 41,594 irregular migrants entered Spain between Jan. 1 and Sept. 30, according to the interior ministry.
The vast majority, more than 36,000, arrived by sea, three times the amount which arrived by sea during the same time last year. Just under 5,000 crossed the land border with Ceuta and Melilla.