Around 300 people launched the dawn assault to cross into the Spanish city, which lies on the northern tip of Morocco, with 214 making it across, Spanish authorities said, in one of the largest such crossings in years.
Among those who failed to reach Melilla, 35 were taken to hospital in nearby Nador, said Hicham Rachidi, secretary general of the Moroccan migrant support group GADEM.
Two of the migrants were in critical condition after being beaten by the Moroccan security forces, including one who was operated on after sustaining severe head injuries, Rachidi told news agency AFP.
"The Moroccan security forces used a lot of violence against the migrants, which completely contradicts their new immigration policy," he said.
Thirty-three migrants eventually discharged from hospital were arrested and taken to the police station in Nador.
The interior ministry declined to comment, when contacted by AFP.
Adil Akid, from the Moroccan Association of Human Rights, gave the same figure of 35 migrants injured in the attempted crossing, two of them critically, with seven sustaining fractures and the rest suffering cuts from the barbed wire placed along the top of the fence.
The assault began at 6am, with the migrants rushing the seven-metre (seven-yard) high border fence from the Moroccan side.
The Spanish authorities said they hurled rocks, sticks and bottles at the civil guards, two of who were lightly injured.
It was the latest in a series of coordinated assaults by African migrants on the border of Melilla, which along with the nearby Spanish territory Ceuta has the European Union's only land borders with Africa.
The two coastal cities sit across the Strait of Gibraltar from mainland Spain, surrounded by Moroccan territory, and are seen as stepping stones for African migrants desperate to reach Europe.
At least 14 people drowned in Moroccan waters on February 6th while trying to enter Ceuta by sea after several hundred tried to storm the land border.
Morocco, under pressure from Spain, has cracked down on the rising influx of sub-Saharans entering the country illegally and heading to its northern shores.
But following allegations that several had died at the hands of police in 2013, Rabat launched a new migration policy, halting deportations to Algeria and offering to "regularize" the papers of the estimated 25,000 people residing illegally on its soil.
The country's National Human Rights Council said on Friday that 12,000 illegal immigrants had requested residency permits — which would allow them to remain and work in Morocco — since the regularisation programme started in early January, with 100 permits so far issued.
But Moroccan immigration experts say changing the way the security forces treat illegal immigrants is a massive task, which requires instilling a "new mentality" among tens of thousands of poorly-trained personnel.