RABAT, Morocco — In a widespread crackdown, sub-Saharan migrants in Morocco are facing arbitrary arrest, banishment to remote sections of the country and, lately, outright expulsion, analysts and rights advocates say.

Rights advocates contend that the raids, which government officials acknowledge, began in the summer and were coordinated with Spain and the European Union to stem the tide of migrants to the Continent. The Moroccan government says they were aimed at only undocumented migrants and human trafficking.

The crackdown began in June and intensified in late July, after at least 600 migrants successfully crossed to the Spanish enclave of Ceuta in northern Morocco, rights groups say. Sub-Saharan migrants, even some with valid residency permits, described wholesale roundups in which they were herded onto buses with little more than the clothes they were wearing and taken to cities hundreds of miles to the south.

Abdoulaye N., 31, a Senegalese immigrant who, like other migrants interviewed for this article, asked that only his given name be used for fear of reprisals, was one of those swept up in the raids.