The Spanish rule over Portugal was a kind of soft colonialism in its own way, as such unions often are. The country as a whole remained distinctly Portuguese, but in one particular instance the city of Ceuta was the most strongly transformed by Spanish presence. Having received many Spanish migrants, the city had pushed to side with the Spanish during the War of Restoration. Despite their successes, the anti-Spanish alliance that supported Portugal (especially the English) would not allow for total Spanish control of entry and out of the Mediterranean. In recompense, the Portuguese ceded the cities of Hermisende and Olivenza to the Spanish, in exchange for regaining the city of Ceuta, the place where the Portuguese empire had begun and ultimately its final bastion.
Although the Portuguese had now re-established themselves among the nations, their control over Ceuta was still not a guaranteed thing. This was especially true considering the hundreds of Spanish who left the city after the Restoration, leaving the city in a weakened position that it still had not recovered from 20 years later. It was by then that the resurgent Morocco, having re-established itself as a strong and unified polity, turned its eye towards Ceuta. With forces marching into place, the city of Ceuta was placed under siege. The Portuguese were more than able to garrison the city against a Moroccan assault, but it was always strained by the nearest city capable of resupplying forces being Lagos all the way in metropolitan Portugal. Begun in 1694, the siege would go on to be one of the longest in history.
The biggest change that the siege brought was the increasing English (later British) presence in the city. More than just Portugal's interests, Ceuta was also important for ensuring that the British would have access through the Mediterranean, and British ships were a regular feature in the city's harbor. Briefly, the British attempted to seize the city in 1701 after the Portuguese briefly sided with the Bourbon claimants, but later in 1702 Portugal shifted to the Habsburg league and the British returned in peace. The incident still proved that England would need to control a city in the region themselves, something accomplished in 1704 with the capture of Gibraltar. With Gibraltar on one side and Ceuta on the other, the entrance to the Mediterranean Sea could now be effectively throttled by Anglo-Portuguese cooperation.
Morocco's siege still dragged on, but after the Battle of Málaga the British sent forces to break the siege and ensure that it remained in Portuguese hands. Portugal was grateful but the 1700s brought an increasing sense that Ceuta was becoming a British holding in practice if not in fact. That Ceuta had become a core part of Britain's strategy in the Mediterranean underscored this further. Still, the standing alliance between Britain and Portugal meant that this wasn't the worst arrangement. But over time, the evolution of Portugal's overseas colonies and its interests elsewhere in Africa meant that Ceuta had become more and more valuable to Britain than Portugal, although Britain wasn't interested in acquiring the city directly. So it was that Britain was more interested in Portugal's control over the city than its own.
British quasi-control over Ceuta was further underscored with Britain's occupation of the city beginning in 1807 as the royal court of Portugal fled to Brazil. A number of times the Portuguese considered ceding Ceuta to Britain, but Britain's hold of Gibraltar made such a cession unnecessary and would have been too aggressive of a move against Europe. The concern was less to throttle control of the Mediterranean, an action that would have drawn the ire of most of Europe, and to ensure continued access. For this reason the British continued to insist that Portugal maintain hold over Ceuta, and this remained the case after the wars' end. Not that there was no desire in Portugal to hold it; being Portugal's first overseas acquisition, it held an important place in the colonial zeitgeist of Lisbon's empire.
Said empire rapidly faltered in the war's wake, and in 1822 Brazil was lost. With her presence in the Americas now gone, Portugal shifted entirely to a focus on Africa and in this regard Ceuta once more took center stage. After the Civil War, in 1834 Ceuta was fully incorporated into Portugal proper, an action with further drew Morocco's displeasure. It was this, combined with disputes over where exactly the border lay, that triggered the Luso-Moroccan War of 1835. Although the war was ostensibly a protection of Ceuta, it also saw Portugal attempting to expand its presence in the Rif as part of this new Africa-focused colonial policy. Though ambitious, military failures outside Ceuta and the outbreak of the September Revolution, meant that these broader plans never came to fruition.
And really, it was the ongoing chaos in Portugal itself that dictated more of Ceuta's affairs more than anything in Ceuta. By and large, the Portuguese settlers in the city tended to be conservative and heavily in favor of Portuguese authority, if only to ensure the city remained Portuguese and did not return to Moroccan control. That remained the case well through the 19th Century, as all through the coups and counter-coups the city of Ceuta remained vocally in support of whichever conservative faction was attempting to either claim power or retain it. Even as Spain and France both began to make moves against Morocco, Ceuta remained a focal point for the Moroccan government, and drove an almost irreconcilable wedge between Lisbon and Marrakesh.
Portugal's broader ambitions had seen Ceuta gain more land outside the Almina Peninsula, but it never grew beyond that. All the same, the city was steadily developed into a distinctly Portuguese city as it had been for centuries, with modern European-style architecture standing in stark contrast to traditional Berber styles seen outside of it. This also went hand-in-hand with attempting to further separate Ceuta from Morocco both culturally through settlement and, starting from 1863, physically with the construction of a large series of walls that were intended to shield Ceuta from any further assaults. More than that, however, it was also meant to keep migrants from Morocco out. In this regard they were only moderately successful, and by 1880 Moroccans made up nearly 45% of the city's population.
In this way Ceuta was only ever mostly Portuguese, something that frustrated the city's administrators to no end. It was also quietly tolerated by them, as despite the declaration of Ceuta as being only for the Portuguese the Moroccans had quickly become the main labor force in the city and a convenient target for the ire of the Portuguese themselves. A common observation among Portuguese Ceutans was that whenever the government carried out deportations, those affected would just turn around and head back into the city. Many had begun to refer to deportations as viagem diurna, literally "day trip", as a colloquialism for how little effect the deportations actually had. But at the same time no one did much to actually stop them. Indeed, many saw it as a more "civilized" outlet for public anger that might otherwise manifest as lynchings, not that those didn't happen either.
When in 1890 the broader Portuguese ambitions for the Cor-de-Rosa scheme were shot dead by British ultimatum, Ceuta's normal staunch support for monarchy and conservatism suddenly weakened. Although Portugal retained sizeable domains in Mozambique and Angola, the "withdrawal" from Zambesia provoked a harsh reaction from those in Ceuta who saw it as a weakening of Portugal's position in Africa and which was the first step to a complete Portuguese withdrawal, or perhaps ceding the entire empire to another European power. Subsequently the city declared its vocal support for the 31 January 1891 revolt, requiring Portugal to send military forces to secure the city. Even when the monarchy was finally overthrown in 1910, Ceuta's republicanism was driven less by political desires and more out of the desire to remain "Portuguese".
In 1911 as a new constitution was implemented Ceuta was reorganized as being part of the Faro District, despite its distance from Portugal proper, as a final settlement of its hazy political status within Portugal. In spite of now being nominally subject to Faro, Ceuta continued to be largely overseen by Lisbon directly. A consequence of the First Republic's instability more than anything else, Ceuta was still largely governed as a colony even if it was counted as part of Portugal itself, in a similar manner to the Azores and Madeira. Its society was also distinctly colonial, and remained staunchly conservative to the extent that with the outbreak of the 28 May 1926 coup d'état Ceuta was one of the first parts of Portugal to declare its support for the revolt and the creation of the Ditadura Nacional.
Over time as the Ditadura Nacional evolved into the Estado Novo, Ceuta became one of the biggest focuses of the new regime's attempts to promote Portugal as a transcontinental state. Ceuta became something of a showcase for the Salazar Regime, loudly declared to be a place that was evidence of lusocization carried out successfully. This ignored the fact that such efforts had been done through heavy settlement and assimilation, something that could not be as easily carried out in places like Angola or Mozambique that were much larger. In fact it was the widespread and continued use of Arabic in the city that made it a hotbed of espionage during World War II, as despite Portugal's nominal neutrality its Allied sympathies brought countless informants from Vichy-controlled Morocco and Algeria to the city.
The post-WWII world had begun to move strongly towards decolonization, something that Lisbon was not prepared to accept. More and more of Portugal's resources began to be directed towards maintaining its empire. But even in this setting Ceuta was an odd outlier. Despite also being separated from metropolitan Portugal it was the most directly connected of its overseas territories, had the largest Portuguese population, and was the most thoroughly lusocized. Even among the Moroccans in the city, attitudes were split between whether or not the city should join Morocco or move for autonomous status within Portugal. The independence of Morocco in 1955 did nothing to lessen these divisions, especially when Spain also asserted the integrality of Melilla, Ceuta's "sister city".
The situation was further complicated in the wake of Operation Vijay, as many Portuguese who had lived in Goa and related territories left following the Indian takeover. Many settled in Ceuta, where they remained just as opposed to Portuguese decolonization there as in Goa. Morocco meanwhile continued to lay claim to Ceuta, and Portugal continued to claim that Morocco had formally ceded Ceuta in the Treaty of Tetuán all the way back in 1835. This remained a point of dispute even after the resignation and later death of Salazar in 1968, and as the world continued to push on both Spain and Portugal to withdraw from Africa tensions in Ceuta often boiled over into clashes in the street between lusophile and lusophobe factions that were done no favors by the growing tensions in the country overall.
At last the Carnation Revolution brought the Estado Novo to an end, and with Portugal firmly settled on decolonization the status of Ceuta came fully into focus. In comparison to places like Timor-Leste, Angola, Mozambique, and Guinea-Bissau, Ceuta was one region that Portugal still saw the capacity to hold onto. After some debate the Portuguese government agreed to hold a referendum on the city's status, which was protested by the Moroccan government. Held in April of 1975, a boycott by Moroccans resulted in the vote falling 80% in favor of continued Portuguese rule. With a mandate in hand, the Portuguese still went to efforts to reorganize the city's administrative status as a "Special Municipality" of the Faro District, a status which in practice gives Lisbon joint administration of the city alongside Faro.
Since this settlement Portugal has continued to assert that Ceuta is an integral part of its country, and Morocco continues to assert that Ceuta is rightfully Moroccan. Despite a round of discussions in 1996 and 2007 the two governments still have not come to a formal accord and Portugal continues to govern it. In 2015 the city's government organized a festival celebrating 600 years of Portuguese rule, an action decried by the Moroccan government as "the celebration of an unlawful and illegal occupation that has continued for six centuries". Their arguments are not unfounded. Ceuta is very much a focus of colonial history for being its "birthplace" inasmuch as anywhere could be said to hold that distinction and to the extent that it marked the modern European incursions into Africa.
Ceuta is very much a city of two separate worlds, as for all the efforts of lusocization and making the city "Portuguese" it still has a distinctly cosmopolitan character that results from both Portuguese and Moroccan presence. Since the Carnation Revolution the city has greatly relaxed its steadfast embrace of Catholicism and in 2010 recognized Eid al-Adha and Eid al-Fitr as public holidays, presently the only part of Portugal that does so. Although not African, the city is also distinctly not European either, and remains part of the fuzzy boundary that separates "Europe" from Africa even though a legal boundary puts Ceuta, a city in Africa, in the European Union. In other words, Ceuta resembles itself more than anything else in the world, apart from perhaps Melilla.
Really, Melilla and Ceuta both form excellent examples of the uncertainty that emerged from continued European presence in Africa. Although both were settled by separate nations at different times the two cities both have equally strong Iberian and North African influences in all realms, be it cultural, religious, architectural, or culinary. Both cities, claimed by Morocco, are also isolated from Morocco by a large series of walls that put a hard barrier between them and the rest of Africa. And both cities are redoubts of conservatism in their respective countries. Ceuta was notably the last place in Portugal with a public statue commemorating Salazar, and remained in place until January 2025 when it was at last removed despite public protests in the city against "destroying history".
Even now, the city of Ceuta is a complicated topic in the broader scope of Portugal. Not even just its broader relations with Morocco and Africa as a whole, but its own past and its present. Ceuta is either a monument to the colonial past of Portugal or emblematic of a diverse and globalized presence. It is either a city that has been dominated by Portuguese rule for nearly 610 years or a city built up by the Portuguese and chose of its own volition to remain part of Portugal in the era of decolonization. Not that any change to the status of Ceuta would mark some major change in Portugal or the world, but Ceuta is one of those launching-off points where everything from colonialism to racism to questions of sovereignty can be discussed. Such is the lot of a city with a foot in two worlds.