The migrants, numbering 1,100 according to Spanish authorities, attempted to cross into the Spanish enclave of Ceuta in the early hours of January 1 in a manner described as "extremely violent and organized," Al Jazeera reports, citing a statement by the Spanish government representative in Ceuta.
Five Spanish and 50 Moroccan officers were hurt engaging with the migrants, who tried "to force open some of the doors in the external fence, using iron bars, wire cutters and large stones with which they assaulted Moroccan forces and [Spanish police]," the Ceuta authorities said.
Ten of the Moroccan officers suffered serious injuries, the country's Interior Ministry reported.
Dozens reached the top of the barbed-wire fence that separates Africa from Europe before they were lifted down by cranes, Reuters reports. Two migrants were allowed to stay in Spanish territory to be treated for injuries; the rest were turned back.
The Interior Ministry of Morocco estimated that 800 migrants had tried to breach the fence and that all had been arrested, according to AP.
"From now on those making such attempts will be presented before the competent judicial authorities who will decree their expulsion from the kingdom or heavier penalties, according the gravity of the act," Morocco's Interior Ministry said in a statement.
Heavier penalties for trying to enter Europe are unlikely to quell the criticism lobbed by human rights groups at Spain for immediately turning migrants around, which they say denies the migrants the chance to properly claim asylum. Ceuta and the nearby Spanish enclave of Melilla are Europe's only land borders with Africa.
On December 9, more than 400 migrants attempted a similar breach of the fence. Migrants also attempt to sail or swim to Europe: also on January 1, Spain's maritime rescue service rescued 52 migrants near Malaga. They were trying to reach the country's southern coast in a small boat.
In the past week, at least two other individuals were arrested for attempting to smuggle migrants into Ceuta or from the enclave to the Spanish mainland.
Even last year, Morocco was being called "the forgotten front line" of Europe's migrant crisis.
"The preoccupation of every migrant is how to get out of Morocco," migrant Sy Mamadou Lamine told Irin News. Lamine had been a teacher in Guinea. "It's not a country where an immigrant can earn money to help his family [at home]. It's a country where young Moroccans don't have jobs, much less us."