The European Union on Friday scrambled to contain one of the largest migrant crises faced by the block in recent years, after tens of thousands of people poured into Spain's enclave in north Africa in just days.

Some 60,000 migrants have crossed into the territory from Morocco, the local regional president Juan Jesus Vivas told reporters. Many swam around a small border barrier that juts out into the Mediterranean Sea, with 34 people dying in the attempt.

The sudden massive influx has sparked an international crisis for Spain's government, drawing criticism from Germany, Italy and Finland and prompting France to tighten checks on its border with Spain.

Madrid has sent troops, more police, including divers, drones and boats, to boost security in Ceuta. Prime Minister Pedro Sanchez and his interior minister rushed to the enclave on Friday.

On Friday, Spain's interior minister said that 25,000 people who had crossed had voluntarily returned to Morocco.