
Gibraltar is a part of the world deeply tied to the UK, but one that enters the consciousness of mainland Britain all too rarely. And if it does, it’s as a curiosity. Or, occasionally, a holiday destination.
Fish and chips in the sunshine. Monkeys crawling over that strange, monolithic Rock. A slice of Britain a stone’s throw from North Africa.
I spent just over a month in Gibraltar towards the end of 2024, and left with a sense that it has stories worth telling properly. It’s a tiny place, but one that has long straddled continents, cultures and faiths.
Nowhere is this history more visible than in one of Gibraltar’s oldest and most captivating pieces of architecture: the Moorish Castle, and an Islamic heritage it carries back over the centuries.
This blog is part of my Building of the Week series, where I explore a different story each week.
A stepping stone into Europe
This part of Europe has always mattered, sticking out as it does from the Iberian peninsula, offering control of the point where the Atlantic meets the Mediterranean, where just 8 miles separate Africa from Europe.
This has made Gibraltar central to multiple conflicts – perhaps most famously during the Second World War, when it was a vital base in Southern Europe for the allies. It remains important to the British Army even in 2026 for all these reasons. And for the exact same logic, it was vital over 1,300 years ago.
In the 7th and 8th centuries, Islam was a new religion, and it was spreading rapidly. Gibraltar acted as a stepping stone into Europe. The first Muslim forces crossed from North Africa to or near Gibraltar in 711, going on to conquer the entire Iberian Peninsula.
Muslim control would last, under a series of dynasties, for more than 700 years (though it wasn’t properly built up as a town for all of this period, and there was a brief intermission when the Castilians took it back in the 14th century).
All said, for longer than Gibraltar has been British, or was Spanish, or even both of those two nationalities put together, it was Muslim.
Throughout much of that time, it acted as a vital link between Al-Andalus, as the lands were known then, back to North Africa. The first fortifications that would become the Moorish Castle didn’t come until the 11th century, with a proper town built around them in the 12th.
The Castilians then briefly took Gibraltar in the 14th century, and a new Muslim dynasty managed to retake it after just a couple of decades. Known as the Marinids, they came from modern Morocco, based in Fez. Fearing another Castilian attack, the new rulers felt that stronger fortifications were needed.
This is when what we see today comes from. Officially called the Tower of Homage, the Moorish Castle was originally part of a much larger set of defences, fortifications and walls, built to strengthen the previous structure.

Stand in Gibraltar’s main square, Casemates, itself a product of British military design, and it still looms down on you, the territory’s oldest building. Slightly ruined but still imposing, the Moorish Castle gazes down on the town: a reminder of a heritage hardly ever mentioned, and to be honest barely visible.
Conquest & erasure
Gibraltar’s Muslim-era came to an end in 1462, when Christian Castilian forces conquered the Rock. This allowed them to cut off the Strait, preventing reinforcements coming from North Africa. Within a few decades, the entire Iberian Peninsula was under Christian rule.
As they did all over the peninsula, Catholic forces went about erasing remnants of the Muslim occupation and asserting the dominance of their rule. A church was built over the historic central mosque – now the site of the Cathedral of St Mary the Crowned, Gibraltar’s Catholic Cathedral.
Even compared to other Spanish towns and cities, very little remains from its centuries of Muslim occupation. In part this is because while it was important defensively, Islamic Gibraltar was never a major settlement in the way other parts of Spain were.
Centuries of further conflict focused in and around the Rock also meant that, for many hundreds of years, this little piece of land was under pretty regular bombardment.
There are ruins of Moorish Baths, also dating to the 14th century, underneath Gibraltar National Museum; and a few traces across town, such as in the courtyard of the Catholic Cathedral.

And then, of course, there’s the Moorish Castle, the most complete and visible survivor, which simply never stopped being useful. It remained in military use for centuries, and then spent time as a prison in post-WW2 Gibraltar.
It was also remarkably sturdy. Using techniques brought over from North Africa known as tapia, essentially packing in earth as well as other materials close together, it was built to withstand siege weapons in the 14th century. It did this so successfully that it survived bombardment after bombardment, all the way up to the Great Siege in the late 18th century.
It was shot at repeatedly, but stayed firm.
Subscribe
Enjoying this?
I write about one fascinating building every week. Subscribe to Building of the Week and get the next one straight to your inbox.
Gibraltar’s connection to its Islamic past does remain in a few other more hidden ways, though. First there’s the name. I mentioned earlier that Gibraltar acted as a landing point for the original Moorish invasion of Spain.
That invasion was led by a commander called Tariq ibn Ziyad; the Rock became known as Tariq’s mountain or, in Arabic, Jabal Tariq. In time, this became Gibraltar.
Then there’s the monkeys, the only wild monkeys in Europe. The truth is nobody knows how they arrived in Gibraltar. But one legend claims that they came from North Africa, travelling through an undersea tunnel.
Perhaps Gibraltar’s connection to Morocco goes ocean deep.

Franco closes the border & Moroccan Gibraltar returns
After the end of Islamic Gibraltar, the Rock has had, to put it lightly, a tumultuous history. There are many stories there, but they’re for future blogs.
For now, let’s skip a few centuries and a couple dozen battles to the 1960s, when Spain was under the authoritarian leadership of General Francisco Franco, and Gibraltar was under British control.
By this point, Gibraltar had almost no Muslim presence*. Although Spain and Britain weren’t, to put it politely, the best of friends, the border was at this point pretty transient. Just across from Gibraltar is the Spanish town of La Linea, and together they form essentially one urban mass, their economies deeply linked. Thousands of Spanish workers crossed it every day.
*Side note: it did have, interestingly, a large and visible Jewish presence. Sephardic Jews had been expelled from Spain under the Spanish inquisition; but after the British took Gibraltar in the 18th century, several hundred Jews moved back across from Morocco to live on the Rock. The first synagogue was founded in 1749, and Gibraltar remains by some counts the largest Jewish community by proportion of population in the world, after Israel.
Then, in 1967, Gibraltar voted overwhelmingly (over 12,000 votes to 44) to stay British, rather than becoming part of Spain. Franco wasn’t very happy with the result. First he restricted Spanish workers’ rights to work in Gibraltar; then, in 1969, he closed the border completely.
Gibraltar, he said, would ‘fall like a ripe fruit’.
This was deeply traumatic on both sides of the border. Families were literally separated, businesses closed. Many Spanish workers struggled to find new work and had to move far afield in search of employment. Ironically, some even ended up in London, because they spoke English.
Gibraltar did not ‘fall like a ripe fruit’
But it didn’t break Gibraltar. Gibraltarian women, many of whom had never worked outside the home, quickly stepped in to cover the shortfall, taking on jobs in hospitals, nurseries and homes across the Rock.
There was another solution, too. Spain might be Gibraltar’s only land border, but if it turns the other way, Morocco is only 8 miles away. And as we have already established, their history is deeply tied.
In their thousands, Moroccan workers came to fill the gap. They worked on naval dockyards, in public services, in construction, filling vital labour gaps. By 1970, several thousand Moroccan workers were in Gibraltar.
It’s tempting to buy into the romantic symmetry of this. A Muslim population, originally crossing over from North Africa, was forced out of a land they had lived on for over 700 years. Five hundred years later and caused by a border dispute, another North African, largely Muslim community came to call the Rock home.
But Moroccan-Gibraltarians were not treated well. Despite the necessary role they were playing for the Rock, they were only given one year residency permits, renewed each year while they were needed.
They lived in dormitories in former Barracks. They weren’t permitted to bring their families over in most cases. And until 1986, if a Moroccan woman became pregnant, they were made to return home at seven months, to prevent them giving birth on the Rock.
Exploitation was rife. When the border reopened in the mid-80s, any Moroccan who had been unemployed for more than six months was liable to be deported.
Recognition
Some of this history has started to heal. Throughout the entire period, many parts of the community, such as unions and Christian youth groups, worked to support Moroccan Gibraltarians, to make them feel welcome and to help them integrate.
In 2000, the Moroccan Community Association in Gibraltar was formed. The work of all these groups has been remarkable, achieving full rights for the majority of Moroccan Gibraltarians.
In 1997, the Ibrahim-al-Ibrahim Mosque opened at Europa Point, the southernmost tip of Gibraltar, staring across the ocean at Morocco. A gift from King Fahd of Saudi Arabia, it serves today’s Muslim population of around 2,000, mostly of Moroccan heritage.
And those Moroccan workers have, a little too late, been given recognition in a small, humble way. At the Unite the Union building in Gibraltar, a plaque was unveiled in 2019, recognising
“The exceptional value of the support provided by the Moroccan workforce at a time when our identity as a people was being undermined by a Fascist state.”
The fight isn’t entirely won, though. Many families still live with the consequences of decades of separation, and long waits for housing remain common for those who came to Gibraltar as guest workers decades ago.
Those two buildings, Gibraltar’s Mosque and the Moorish Castle, sit at opposite ends of the territory. The Castle gazes down over the town, close to the border with Spain; the Mosque sits just a few metres from the ocean.
On a clear day, you can see the mountains of Morocco. Together, they bookend a history of Islamic Gibraltar stretching back a millennium.


Gibraltar’s modern mosque & a vintage postcard showing Casemates Square and the Moorish Castle, both sourced via Wikimedia Commons
Subscribe
Liked this? There's a new one every week.
Every week I explore one building in Europe and the history hidden behind its walls. Different eras, different styles, always a story worth telling. Subscribe and never miss one.
Read more building of the Week posts
Roupell Street: one of London’s most picturesque streets, the family fraud behind the name
A perfectly preserved Georgian street hidden behind Waterloo, and the audacious Victorian forgery committed by the family that gave it its name.
Neasden Temple, London: Empire, Expulsion and a Marble Wonder Just Off the A406
The story of how this magnificent temple came to Neasden encapsulates so much of what makes London extraordinary: irrepressible communities, masterpieces in the most unexpected places. It’s also a story that spans continents, empire, and expulsion.
County & Cross Arcades, Leeds: a story of beauty and displacement
Leeds’s County Arcade is a Victorian jewel. But who lived on the land before it was built, and where did they go?
Thanks for visiting my blog! This post may contain affiliate links - which means if you make a purchase, I'll receive a small commission, at no extra cost to yourself. This helps me keep this site running for free.
