A spokesman for the central government's representative office in Ceuta, on Morocco's northern coast, said 18 people were "slightly" injured, including 15 migrants and three policemen.
The migrants used "wire cutters and mallets to cut through the doors" in the high double fence, he added.
Ceuta and Melilla, also a Spanish territory in North Africa, have the EU's only land borders with Africa.
Finalmente @CruzRojaCeuta atiende a 67 personas entre el vallado, los Rosales y el CETI, de los que traslada a 14 por heridas y fracturas— Cruz Roja Ceuta (@CruzRojaCeuta) August 1, 2017
As a result, they are entry points for migrants desperate to get to Europe and who regularly try to climb the high border fences, swim along the coast or hide in vehicles.
Ceuta is now ringed by a double wire fence eight kilometres (five miles) long. The six-metre high fence also has rolls of barbed wire.