The incident took place in the same area where over 600 migrants were able to force their way into what is effectively European Union (EU) territory on July 26.
Spanish media reported that the migrants used high levels of violence in their efforts to cross the frontier -- throwing sticks, stones and batteries, as well as quicklime and excrement at the Civil Guards on the border.
The Civil Guards were unable to stop the attack and seven members suffered injuries and burns.
A total of 116 migrants are confirmed to have reached the temporary center for immigrants in Ceuta, although it is thought there could be others in the town still to arrive.
Spanish Prime Minister Pedro Sanchez tweeted a message of "support to the security forces who are facing up to the migratory challenge in an exemplary manner, especially the agents who have been injured today".
"The government is working for dialogue and cooperation with their (the migrants) countries of origin for a shared, efficient, and humanitarian management of migration," said Sanchez.
More about: Ceuta