About 200 migrants tried to storm the barbed wire fence at dawn but Spanish and Moroccan security forces prevented all but around 50 from entering the coastal city, a spokesman for the Spanish government's representative in Melilla said.
One migrant suffered a fractured leg and was hospitalised and six Spanish police officers were “lightly” injured with bruises and cuts, he added.
The only other mass attempt by migrants to enter Melilla this year happened in May when roughly 50 migrants managed to scale the border fence and get across.
“There is not as much pressure on the border,” the spokesman said.
Spain's two North African enclaves, Melilla and Ceuta, have the European Union's only land borders with Africa.
They are often used as entry points into Europe for African migrants, who either climb over their border fences or try to swim along the coast.