More than 2,000 people stormed the area on Friday, with around 500 managing to get into a border control area after an iron fence was cut with shears.
Moroccan authorities said the individuals died as a result of a “stampede”.
Human rights organisations, including Amnesty International and Walking Borders, have called for an an immediate investigation into the tragedy, amid allegations of police ‘violence’.
The founder and spokesperson of Walking Borders, Helena Maleno Garzón, confirmed the death toll of 37 and warned that “the figures are not final and may continue to increase.”
Esteban Beltran, director of Amnesty International Spain, said: “Although the migrants may have acted violently in their attempt to enter Melilla, when it comes to border control, not everything goes.
“The human rights of migrants and refugees must be respected and situations like that seen cannot happen again.”
Disturbing footage was also released by Moroccan Human Rights Association on social media that appeared to show dozens of migrants on the ground, many of them motionless and a few bleeding, as Moroccan security forces stood over them.
In another of the videos, a Moroccan security officer appeared to use a baton to strike a person lying on the ground.
“They were left there without help for hours, which increased the number of deaths,” the human rights group said on Twitter. It also called for a “comprehensive” investigation.
One man who tried to cross the border told Spanish newspaper El Pais: “The Moroccan agents were very violent, more aggressive than other times, and people panicked. That’s what provoked the stampede.”
In a statement, Morocco’s Interior Ministry said 76 civilians were injured along with 140 Moroccan security officers.
Spanish prime minister Pedro Sanchez has condemned what he described as a “violent assault” and an “attack on the territorial integrity” of Spain.
Spanish officials said 49 Civil Guards sustained minor injuries in the incident.
Mr Sanchez said: “If there is anyone responsible for everything that appears to have taken place at that border, it is the mafias that traffic in human beings.”
Friday’s crossings were the first attempt since relations between Spain and Morocco improved in March after a year-long dispute centred on Western Sahara, a former Spanish colony annexed by Morocco in 1976.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies