Spain’s Civil Guard has cleared Ceuta’s largest beach of migrants after thousands of people had been living there following the mass arrival from Morocco in late July. The operation began early in the morning at El Trampoline beach, where nearly 3,500 people had been staying in makeshift shelters.

The migrants were transferred to two reception facilities established by the central government, which together have capacity for around 1,800 people. About 1,200 migrants from sub-Saharan Africa were moved to a military site in Loma Margarita, while roughly 200 North Africans were transferred to another facility in Loma Colmenar, close to the El Tarajal border crossing.

Authorities said the beach clearance was carried out for humanitarian reasons. Many migrants had been sleeping in improvised shelters made from cardboard and branches. The reception centers have camp beds, dining tables and toilets, according to the Ministry of Inclusion and Migration.

The cleanup was temporarily suspended in the early afternoon after around 500 people returned to the beach, saying they wanted to collect or look for personal belongings. Authorities expect the operation to continue over the coming days.

Between 5,000 and 8,000 migrants were still believed to be in Ceuta following the migration surge at the end of July, when about 72,000 people entered the Spanish exclave over a two-day period. Authorities said most of those who crossed into Ceuta subsequently returned to Morocco voluntarily.