MADRID — About 80,000 African migrants are heading for Spain’s two enclaves along the Moroccan coast, leaving Spain struggling to contain the efforts that are coming in larger and increasingly coordinated surges in recent days.

The Spanish interior minister, Jorge Fernández Díaz, said Thursday that the situation at the enclaves, Ceuta and Melilla, was a problem not only for Spain, but for all of Europe, and needed to be handled “in cooperation with the European Union.”

The government of Prime Minister Mariano Rajoy has faced intensifying criticism — within Spain and from the union — over its defense of the enclaves.