Moroccan authorities said the individuals died as a result of a "stampede" of people who attempted to climb the iron fence that separates the city of Melilla and Morocco.
In a statement, Morocco's Interior Ministry said 76 civilians were injured along with 140 Moroccan security officers.
Two members of Morocco's security forces and 33 migrants who were injured during the border breach are being treated at hospitals in the Moroccan cities of Nador and Oujda.
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."
His remarks came as the Moroccan Human Rights Association shared videos on social media that appeared to show dozens of migrants lying on the ground, many of them motionless and a few bleeding, as Moroccan security forces stood over them.
"They were left there without help for hours, which increased the number of deaths," the human rights group said on Twitter.
It called for a "comprehensive" investigation.
In another of the association's videos, a Moroccan security officer appeared to use a baton to strike a person lying on the ground.
Amnesty International has expressed its "deep concern" over the events at the border.
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."
Five rights organisations in Morocco and APDHA, a human rights group based in the southern Spanish region of Andalusia, also called for inquiries.
The International Organisation for Migration and UN refugee agency UNHCR also weighed in with a statement that expressed "profound sadness and concern" over what happened at the Morocco-Melilla border.
"IOM and UNHCR urge all authorities to prioritise the safety of migrants and refugees, refrain from the excessive use of force and uphold their human rights," the organisations said.
The Spanish Commission for Refugees condemned what it described as "the indiscriminate use of violence to manage migration and control borders", and expressed concern that the violence had prevented people who are eligible for international protection from reaching Spanish soil.
A spokesperson for the Spanish government's office in Melilla said around 2000 people had attempted to make it across the border fence but were stopped by Spanish Civil Guard Police and Moroccan forces on either side of the border fence.
A total of 133 migrants made it across.