Fifty Moroccan and five Spanish border guards were injured when 1100 African migrants attempted to storm a border fence.
The migrants were attempting to reach Spain's North African enclave of Ceuta.
Only two were successful, but both were injured scaling the 6m fence and needed hospital treatment. One guard lost an eye, officials said.
The attempt comes after more than 400 migrants succeeded in breaching Ceuta's fence in December.
Hundreds of sub-Saharan African migrants living illegally in Morocco try to enter Ceuta and Melilla, Spain's other North African enclave, each year in hope of getting to Europe.
The enclaves are Europe's only land borders in Africa.
But most migrants are intercepted and returned to Morocco, while those who make it over the fences are eventually repatriated or released.
This latest attempt - described as "extremely violent and organised" by the Spanish government's representative office in Ceuta - took place at 4am local time on New Year's Day.
Dozens made it to the top of the fence, but Spanish agents sent them directly back to Morocco.