Around 1,000 migrants have tried unsuccessfully to climb over the fences separating the Spanish enclave of Melilla from Morocco.
The representative for Spain's government in Melilla said Moroccan border guards repelled the attempted crossing on Tuesday.
Spanish border guards remained positioned on the European Union side of the frontier, authorities added.
Migrants tried to cross the border at around 6 am local time "in a coordinated and perfectly organised manner, before dividing into several sub-groups," the Melilla prefecture said in a statement.
The failed attempt came less than a week after an unprecedented 3,700 people tried to enter the city last week in two separate incidents.
A total of 491 migrants managed to climb two 6-metre-high fences before another 380 reached Melilla the day later. Just 1,092 migrants had managed to enter Melilla in the whole of 2021.
People fleeing violence or poverty in Sub-Saharan Africa sometimes use mass border incursions to try to reach two Spanish enclaves in northern Africa, Ceuta and Melilla, before continuing to continental Europe.
The attempted crossings include violent clashes between migrants and border guards.