MADRID: Police on Friday moved hundreds of migrants from the beaches of Ceuta to a temporary camp in the Spanish enclave's port area, weeks after a record influx into the tiny territory.

During the transfer, the paolice struggled to contain crowds of people jostling to secure one of the 1,700 places at the new tented site after weeks of living on the beaches.

More than 70,000 migrants streamed into Ceuta from Morocco on July 30 and 31 in an unprecedented, chaotic surge that left scores dead and sparked European Union infighting over the sensitive topic of immigration.

Most returned in the following hours, but thousands remained in precarious conditions in the small city, sleeping in the streets or in makeshift tents.

Deteriorating conditions have fuelled tensions with local residents, with near-daily protests calling for a return to normality, some of which have drawn support from far-right groups.

Many accuse the government of abandoning the enclave in the middle of a humanitarian crisis.

Police on Friday started rounding up the migrants at 6:30 am (0430 GMT), according to a Spanish government source in Ceuta.

By noon, all places at the new camp had been taken and the transfer operation had wrapped up, a government source told AFP, bringing the enclave's total temporary accommodation capacity to 6,000 people.

Ceuta authorities estimate that 13,000 migrants have remained in the 18.5-square-kilometre (7.2-square-mile) territory. The central government says the figure is lower.

The Spanish government went ahead with the transfer despite opposition from the conservative local authority.

"This is a key step," digital transformation minister Oscar Lopez said Friday, arguing that moving migrants off the beaches would help authorities process cases more quickly and ease pressure on public spaces.

Socialist Prime Minister Pedro Sanchez has faced strong criticism over the handling of the crisis. He is also in dispute with Italy, which temporarily reimposed border controls.

The government has had to identify the thousands of migrants who have remained for weeks to check if they are entitled to asylum, while unaccompanied children cannot be summarily deported.

Last week, Madrid said more than 5,300 of the migrants who remained in Ceuta after July's influx had returned to Morocco within a month.

- 'An invaded city' -

The migrant surge has also generated a constant churn of negative headlines and dominated the political debate for weeks.

But with no end to the crisis in sight, worry and anger are growing among Ceuta's 84,000 residents who accuse the government of abandoning them.

The migrants are living in informal camps while the leftist government works to expand emergency accommodation for them.

Isolated episodes of violence have broken out, including fights between migrants, the stoning of a military patrol and reports of sexual assault.

The row has become entwined with Spain's broader political debate over migration ahead of next year's election, with the conservative and far-right opposition accusing Sanchez's government of failing to protect Spanish sovereignty in Ceuta.

Doubts about what the government knew beforehand and the possible role of Morocco, with which Madrid has spent years trying to improve relations, have also increased the political fallout for Sanchez.

Conservative Populist Party leader Alberto Nunez Feijoo seized on Friday's scenes, saying that images of migrants running to secure places in the camp showed "the loss of control in Ceuta -- now an invaded city -- is absolute".

"That is how they should leave. Running. And the sooner, the better," said far-right Vox party leader Santiago Abascal on X.