About 350 migrants tried unsuccessfully early Saturday morning to cross the fence separating Morocco from the Spanish enclave of Melilla, a Spanish government spokesman said.
The Spanish border guards were alerted around 5:30 am by their Moroccan counterparts that "a group of 350 sub-Saharan Africans" was trying to climb the fence near the border post of Barrio Chino.
The Guardia Civil then dispatched a helicopter to repel them, the spokesman continued, saying, without providing further details, that "no one has managed to cross".
Another group of more than 300 people tried to enter Melilla on 20 August, but again none succeeded, he added.
Three days earlier, more than 50 of the 150 migrants who stormed the fence managed to enter the Spanish territory.
And on July 22, more than 230 entered Melilla in one of the largest influxes in recent years.
The two tiny Spanish enclaves of Ceuta and Melilla have Europe's only land border with Africa, which is a major draw for migrants.
In mid-May, Spain was caught off guard when more than 10,000 people tried to swim or use small inflatable boats to reach Ceuta, while Moroccan border guards looked the other way.
The influx occurred during a diplomatic crisis between Spain and Morocco, with Madrid angering Rabat by allowing a Western Saharan separatist leader to be admitted to a Spanish hospital.
This widespread border violation was widely perceived as a punitive measure taken by Morocco.
Although most of these migrants were immediately turned back, about 2,500, including about 800 unaccompanied minors, were still in Ceuta at the end of July, according to local authorities.
Moroccan villagers keep communal store tradition alive
Morocco stunned Brazil 2-1 in Saturday's friendly
Morocco and Brazil go head to head in Tangier
Italy's coast guard rescues more than 700 migrants
Go to video
Algeria dismantles migrant smuggling network to Europe
Morocco's squad to play Brazil 25 years after last face-off