Anti-migration protesters gathered outside the Moroccan consulate in the southern Spanish port city of Algeciras on Sunday, before marching towards the port.
Activists called for Prime Minister Pedro Sanchez to resign and demanded the deportation of migrants from Spain.
Demonstrators chanted 'Save our nation, remigration' as they marched through the city, waving Spanish flags and burning flares.
"Spain isn't against immigration, but you can't come here to impose your cultures and live off handouts. If you come to work, you're welcome, but everything must be on our terms and according to our rules. If that works for you, fine. If not, go back to your home countries."
The protest followed a huge surge in migrant arrivals from neighbouring Morocco into the Spanish enclave of Ceuta. Spanish officials estimated that between 50,000 and 60,000 people entered the territory between Thursday and Friday.
The Interior Ministry said most had since returned to Morocco. Many left voluntarily, while Spanish soldiers and police were deployed across the enclave.
"I think the situation in Spain is getting worse and worse. What's happening in Ceuta is a joke. I don't know how they let this happen. It's a disgrace, and I think Pedro Sanchez should be in jail."
The demonstrators repeated demands common among Spain's far-right parties and groups, including tighter border controls, the closure of migrant reception centres and the deportation of people living in the country without legal status.
The European Union (EU) is due to hold emergency talks on Tuesday over the situation in Ce