Spain stepped up diplomatic pressure on Rabat Tuesday as its prime minister flew into Ceuta, vowing to "restore order" in the North African enclave after a record 8,000 migrants reached its beaches from Morocco.

With diplomatic ties already strained between the two nations over a political spat linked to Western Sahara, Spain's top diplomat summoned Morocco's ambassador to express her "displeasure" after thousands of migrants were able to enter the enclave as Moroccan security forces turned a blind eye.

Migrants try to enter either by scaling the tall barrier fence or swimming Migrants try to enter either by scaling the tall barrier fence or swimming Photo: AFP / Antonio Sempere

"I reminded (the ambassador) that border control has been and must continue to be the joint responsibility of Spain and Morocco," Foreign Minister Arancha Gonzalez Laya told journalists.

Soon after, Morocco's foreign ministry said it had recalled its ambassador from Spain.

Spanish Prime Minister Pedro Sanchez flew into Ceuta after the record influx which has overwhelmed the tiny peninsula.

Some of the migrants swam into the Spanish enclave Some of the migrants swam into the Spanish enclave Photo: AFP / Antonio Sempere

"We will restore order in the city and along our borders as quickly as possible," Sanchez vowed ahead of a scheduled visit to Melilla, Spain's other coastal enclave, some 400 kilometres (250 miles) to the east.

Spain's interior ministry said that nearly 8,000 migrants had arrived in Ceuta since Monday morning, but half that number had already been sent back to Morocco.

Moroccan migrants climb a rocky cliffside as a policeman watches in the northern town of Fnideq as they attempt to cross the border from Morocco to Spain's North African enclave of Ceuta on May 18, 2021.At least 5,000 migrants, an unprecedented influx at Moroccan migrants climb a rocky cliffside as a policeman watches in the northern town of Fnideq as they attempt to cross the border from Morocco to Spain's North African enclave of Ceuta on May 18, 2021.At least 5,000 migrants, an unprecedented influx at a time of high tension between Madrid and Rabat, slipped into Ceuta on May 17, a record for a single day, Spanish authorities said. Photo: AFP / FADEL SENNA

Madrid will send an additional 50 police officers to reinforce the 200 already deployed on Tuesday, while another 150 were on standby, the ministry added.

The government said it had set up a system to "streamline" the return of migrants to Morocco that could "operate 24 hours a day".

One migrant drowned as hundreds attempted to swim or wade along the coast to reach Spanish soil in Ceuta One migrant drowned as hundreds attempted to swim or wade along the coast to reach Spanish soil in Ceuta Photo: AFP / FADEL SENNA

"This sudden arrival of illegal migrants poses a serious crisis for Spain and for Europe," warned Sanchez, who cancelled a Tuesday trip to Paris to attend an Africa financing summit.

"What has taken place is an attack on our borders," said Deputy Prime Minister Carmen Calvo.

Would-be migrants gather in the Moroccan town of Fnideq waiting for their opportunity to slip across into the Spanish enclave Would-be migrants gather in the Moroccan town of Fnideq waiting for their opportunity to slip across into the Spanish enclave Photo: AFP / FADEL SENNA

Ceuta and Melilla have the European Union's only land borders with Africa, making them popular entry points for people fleeing poverty and war in Africa.

EU home affairs commissioner Ylva Johansson urged Morocco to act to halt the "worrying" increase in arrivals. European Council chief Charles Michel voiced solidarity with Madrid, tweeting "Spain's borders are the European Union's borders".

Map locating the Spanish enclave of Ceuta in Morocco, and the town of Fnideq in Morocco. Map locating the Spanish enclave of Ceuta in Morocco, and the town of Fnideq in Morocco. Photo: AFP / STAFF

Analysts said it was clear Morocco had turned a blind eye to the human tide surging into Ceuta to put diplomatic pressure on Spain to recognise its sovereignty over Western Sahara.

Most of the migrants had crossed into Ceuta largely unimpeded by Moroccan security forces on Monday.

By Tuesday morning however, Rabat had deployed reinforcements at the Fnideq border crossing who fired tear gas to disperse those trying to slip across, an AFP correspondent reported.

The migrants reached Ceuta by swimming or by walking at low tide from Moroccan beaches, some using rubber dinghies The migrants reached Ceuta by swimming or by walking at low tide from Moroccan beaches, some using rubber dinghies Photo: AFP / FADEL SENNA

"The situation is much calmer. The Moroccan authorities are blocking their nationals from coming along the beach," a source at the Spanish government delegation in Ceuta told AFP.

While he said the arrivals had stopped by midday, live footage from Spain's RTVE public television appeared to show scores of migrants wading through the water.

Early Tuesday, another 300 migrants tried to cross into Melilla by scaling a high barrier, with 86 making it through.

The migrants reached Ceuta by swimming or by walking at low tide from Moroccan beaches a few kilometres to the south, some using inflatable swimming rings and rubber dinghies.

One man drowned en route, Spanish officials said.

Ouarda, a 26-year-old single mother from the nearby town of Tetouan, said she had come when she saw on Facebook it was possible to cross.

"I took a taxi here with my friend as I can't feed my family anymore. I'm not scared -- I'll either die or I'll cross."

Videos on social media showed dozens setting off from rocky outcrops, some wearing just beachwear.

The crisis comes against the backdrop of soaring tensions with Rabat over Madrid's decision to provide medical treatment for the leader of the Western Sahara independence movement, who has been seriously ill with Covid-19.

Rabat was infuriated when news leaked that Polisario Front leader Brahim Ghali had flown to northern Spain in mid-April for hospital treatment.

The Polisario Front has long fought for the independence of Western Sahara, a former Spanish colony that is mainly under Moroccan control.

The Moroccan authorities have long wanted Spain to acknowledge their authority over Western Sahara, as Washington did in December under former president Donald Trump.

In allowing the migrant surge into Ceuta, Morocco had sent a "strong message", said Isaias Barrenada, an international relations professor at the Complutense University of Madrid.

But Spain's foreign minister insisted Rabat had "assured" Madrid there was no connection between the migrant surge and Ghali's presence in Spain.