About 50 migrants attempted to cross the six-metre (20-foot) high fence on the border with Morocco at 7:00am (0500 GMT), a spokesman for the Melilla government told AFP.
They were part of a group of 130 people who had attempted to make it to the Spanish territory, most of whom were arrested before they reached the fence.
Authorities said that all the migrants were men, with "no minor reported", and that two had slight injuries and were treated at a local hospital.
Melilla has for some years been a flashpoint for African migrants trying to enter Spain, with authorities stepping up security by strengthening border barriers after thousands of immigrants tried to scale existing fencing in 2005.
Each year, thousands of Africans seek to cross into Melilla and another Spanish enclave, Ceuta -- which have the only land borders between Africa and the European Union.
Last week, 87 African migrants made it into Ceuta after hundreds charged the border, with 13 people hurt in the attempt.