Moroccan security forces managed to stop some of the migrants from reaching the fence that seals off Melilla -- one of only two land borders between Africa and the European Union -- but around 30 people still reached it and clambered onto the railings, they said.
Two of these managed to get across into the Spanish territory, while one man was seriously injured when he fell from the metres-high fence near the Barrio Chino crossing, authorities in Melilla added in a statement.
The man was taken to hospital in Melilla with severe head injuries -- along with three others who were slightly hurt as they too fell from the fence.
Other migrants were still clinging onto the railings in high winds, prompting firemen to lay out mattresses and other material at the base of the fence in an attempt to break any fall.
Authorities said the area around Barrio Chino is favoured by migrants and refugees trying to make it into Spain, as the "cluster of homes there allows them to crouch and hide, making it harder for security forces to intercept them."
Melilla and Ceuta, another Spanish enclave nearly 400 kilometres (250 miles) away, have for some years been a flashpoint for African migrants trying to enter Spain, with authorities stepping up security by strengthening border barriers.
So far this year, according to Melilla authorities, there have been a dozen attempts to cross the border fence there, with more than 100 managing to enter the Spanish enclave.
But authorities said this pales in comparison with 2014, when more than 2,000 migrants and refugees managed to enter Melilla.