Thousands of people have streamed into the tiny Spanish territory of Ceuta in north Africa from Morocco, with at least 18 dying in the attempt, prompting Spain to deploy its military to restore the border.Videos and images from the frontier showed crowds of people, mainly Moroccans, walking around the breakwaters at an urban beach near a border checkpoint with Morocco on to local roads. The majority appeared to be young men, though there were also families with women and children.It was not immediately clear what prompted so many people to cross to Ceuta. Spain’s government said it would send the armed forces to help the civil guard in Ceuta. The Spanish prime minister, Pedro Sánchez, was expected to visit on Friday.An autonomous Spanish city in continental AfricaSpanish soldiers control the border area in Ceuta on Friday. Photograph: Fabian Bimmer/ReutersCeuta and the larger Spanish territory of Melilla, which is 250 miles east, are located on the Mediterranean coast at the tip of Africa. Both autonomous cities belong to Spain and share the European Union’s only land borders with Africa.In Spanish possession since 1580, Ceuta is home to a mixed population of Christians and Muslims, and Spanish and Moroccan residents and day workers who live in relative harmony.Morocco does not officially recognise Ceuta and Melilla as Spanish territory and often refers to them as occupied lands.A migration and diplomatic flashpoint between Spain and MoroccoA Spanish soldier watches over people who arrived in Ceuta, May 2021. Photograph: Brais Lorenzo/EPACeuta has been a flashpoint in diplomatic crises in recent memory between Madrid and Rabat. In May 2021, the Moroccan government dropped its border controls and let about 8,000 people from Morocco and sub-Saharan countries pour into Ceuta in just two days.The move was broadly interpreted as retaliation for Spain’s decision to allow a pro-independence leader from the disputed Western Sahara region to receive medical treatment at a Spanish hospital.Tensions were defused only after Sánchez shifted his country’s longstanding position on Western Sahara and met the Moroccan king, Mohammed VI, the following year.A destination for migrants trying to reach EuropeA man gestures towards the camera after crossing into Ceuta on Thursday. Photograph: Jaime Lopez/ReutersSpain is a main point of arrival into Europe for people seeking better economic opportunities or an escape from violence in their home countries. Ceuta and Melilla are heavily fortified as they are seen as destinations for those trying to reach Spain from Morocco and other parts of Africa.Many migrants who reach Ceuta or Melilla are immediately turned back, while others are held in migrant shelters and can apply for asylum in Spain.To reach Ceuta, people often swim from the Moroccan town of Fnideq, covering about 3 miles (5km). Others attempt the crossing from the nearer town of Belyounech.Migrant arrivals to Ceuta and Melilla are generally much lower than those reaching Spain through the Canary and Balearic Islands.Spain’s overall immigrant population has grown considerably in recent decades, with about 10 million people in the country of 50 million having been born elsewhere.Many are from Colombia, Venezuela and Morocco and work in key sectors of the Spanish economy including agriculture, tourism and the services sector.