More than 1,000 sub-Saharan migrants rushed the six-metre razor-wire fence that marks the border of Spain's North African enclave of Melilla early on Wednesday morning, with some 400 managing to make it over the towering fence, yelling with joy as they touched Spanish soil.

"There were waves [of people], they were quite difficult to stop," Juan José Imbroda, the mayor of Melilla, said in a radio interview. Despite efforts by Moroccan and Spanish police to push back the migrants, he said the pressure was so great that "a chunk of the exterior fence gave way".

On entering Melilla, the jubilant migrants kissed the ground and congratulated each other on making it to Europe. Many of them had spent years travelling across north and sub-Saharan Africa followed by months of living in rough, makeshift campgrounds on the Moroccan side of the border, waiting for an opportune moment to rush the frontier.

The migrants will now probably be held at Melilla's temporary migration centre while authorities decide whether to grant them asylum or send them back to their countries of origin.

As news of the border crossing spread, officials in Melilla expressed concerns about overcrowding at the migration centre. The centre was built to shelter 500 people and is currently housing more than 2,000, said Imbroda. "Imagine the huge problem we will have with 400 more on top of the 2,000 people already there."

The centre is "at its limit," admitted Spain's minister of the interior, Jorge Fernández Díaz. After a decade of relative calm, the number of migrants attempting to cross into Spain's two autonomous north African cities, Ceuta and Melilla, has risen in the past few years.

In 2013, some 4,200 undocumented migrants crossed into Spain from the two enclaves, a 49% rise over 2012 figures, according to the ministry. Several members of the ministry are expected to travel to Melilla in the coming days to assess the situation.

As Spain ramps up security along its coastlines, an increasing number of migrants are choosing to try their luck at the three rows of fences lined with razor wire that mark the border between Morocco and the enclaves. Desperation has also bred creativity; migrants have been caught recently trying to elude border police by hiding in suitcases or in the undercarriages of cars at border crossings.

Tensions between the EU and the Spanish government over the border crossings flared earlier this year after 15 migrants drowned in the Mediterranean after dozens tried to enter Ceuta by swimming from a nearby beach.

Human rights groups and migrants said the Spanish police tried to keep them from crossing into Spanish territory by firing rubber bullets and spraying them with tear gas. The Spanish government has since said that its guards are now banned from using bullets to repel migrants.