UN Secretary General Kofi Annan is "deeply concerned" about the plight of African migrants trying to cross from Morocco into Spain.
Eleven people have died in the past 10 days trying to cross the border
He urged the Spanish and Moroccan governments to deal with the situation humanely, his spokesman said.
His comments come after six migrants died trying to scale a fence to enter the Spanish enclave of Melilla.
The EU and the UN are sending teams to Morocco, amid growing criticism of how the authorities are treating migrants.
"The secretary-general is deeply concerned about the very serious situation of migrants trying to cross from Morocco into Spain through the enclaves of Ceuta and Melilla," a spokesman for Mr Annan said in a statement.
Mr Annan "believes these regrettable events in this one region of the world point to a wider problem in dealing with the inevitable and necessary flow of people across borders", the statement added.
The aid agency, Medecins Sans Frontieres, said on Friday that it had found more than 500 migrants abandoned by Moroccan police in the Sahara desert without food or water, some of whom had been illegally expelled by Spanish police.
Human rights groups have also criticised Spain's decision to resume the deportation to Morocco of migrants who had already reached Spanish territory.
At least 70 migrants were expelled from Melilla, in the first set of official expulsions expected under a revived 1992 accord between Spain and Morocco.
It allows illegal entrants to be sent back to Morocco, even if they are of different nationalities.
Until now, migrants who successfully entered the enclaves have been housed in holding centres or sent to mainland Spain to await expulsion to their country of origin, often resulting in their release.