Local officials had appealed to Madrid for help after a recent rise in attempted crossings, but there were chaotic scenes on Thursday as border controls apparently broke down.

Spain later deployed its armed forces to bolster security in Ceuta and at its sister city of Melilla, where between 300 to 400 crossings were also reported overnight.

The astonishing estimation by Spanish officials suggests the number of migrants who entered into Ceuta in the last day or so could be more than half of the population of the city – which sits at around 83,600 according to the latest local figures.

Officials say at least 7,000 of those who crossed illegally into the territory in the last 24 hours are minors.

Spain’s interior ministry said it was working with Morocco to ensure the return of all who crossed illegally into its territory “as soon as possible”.

If the official estimates are correct, this would be the largest number of migrants to cross into Ceuta since May 2021, where more than 10,000 people entered the city.

Spanish prime minister Pedro Sánchez is set to visit Ceuta later on Friday.