A regional government statement said Spanish and Moroccan police, aware of the pending attempt, managed to force most of the crowd back early today.
It said some 150 migrants managed to get into the area between the fences but were returned to Morocco.
Spain's North African city enclaves of Melilla and Ceuta are regularly targeted by large groups of African immigrants living illegally in Morocco and trying to cross into Europe in search of a better life.