The attempt to cross into Spain took place at 5.30am near Melilla's Barrio China border post, Spanish daily ABC reported.
Those migrants who did manage to cross the six-metre (20-foor) high border fences into Spanish territory ran towards the already overcrowded CETI refugee centre.
A further ten immigrants spent some two hours on top of one of the border fences before coming down at around 7.30pm. Two remained on the fence at 8.30am.
The final number of people who attempted to cross is not yet known, but Wednesday's border 'assault' is considered one of the largest ever, ABC said.
"It was a very large number," the president of the city of Melilla, Juan José Imbroda, told Spanish public radio RNE. "An exterior part of the barrier was pushed over."
Imbroda said the Moroccan authorities cooperated well with the Spanish border guard.
"The Guardia Civil police deployed in large numbers but it was hard to stop it," he added.
In 2013 4,235 undocumented migrants crossed into the two territories, up 49 percent from 2,841 in 2012, although the figure was 15 percent down on 2001 figures, the interior ministry said in a statement.
The flow of desperate Africans heading to Ceuta and Melilla has surged over the past year, with migrants regularly storming the border fences.
Others try to smuggle themselves past checkpoints hidden in the undercarriages of cars or sail across the strait of Gibraltar to mainland Spain in flimsy inflatable dinghies.
The government has said recently, however, that the number of undocumented migrants reaching Spanish shores by boat eased by 15 percent overall to 3,237 in 2013. That number was also down 90.7 percent on 2006 figures when 39,180 reached Spain by boat, the ministry added for context.
On February 6th around 15 migrants drowned in Moroccan waters while trying to swim to Ceuta from a nearby beach.
Story continues below…
Spain's government agreed last week to spend €2.1 million ($2.9 million) to boost security at the Ceuta and Melilla borders.
Migrants who reach the cities are taken to overcrowded processing centres while authorities decide whether to grant them asylum or send them back to their countries of origin.
The Spanish interior ministry said on Tuesday that it sent back 23,889 "irregular immigrants" in 2013, down 10 percent from 2012.