Authorities said 300 people stormed the heavily fortified border between Morocco and the Spanish enclave Melilla in what they called a mass “violent crossing”.
Some 209 migrants succeeded in reaching Spain in the incident.
Spain’s two North African enclaves, Ceuta and Melilla, are a common target for entry into the European Union by migrants who try to climb the border fences or enter the territories by sea.
One Civil Guard police officer was injured in an attack by a migrant, the Spanish government said.
Authorities said four of the migrants who reached Spain received treatment for injuries sustained during the crossing.
The International Organisation for Migration (IOM) said Spain has already received more arrivals this year than in the whole of 2016.
IOM said no fewer than 8,200 migrants had arrived on Spanish shores by Aug. 6, 2017 .
The UN agency said Italy remains by far the biggest gateway, accounting for 85 per cent of arrivals by sea since the start of 2017 with more than 96,400.
It said Spain is catching up with Greece, where 11,713 have landed.