Tourists take the cable car to the Top of the Rock to pester the monkeys that live at the summit, but the best thing about this clifftop arena is the view. Standing on the cliff edge, gazing down at the big ships traversing the busy strait below, you realize what makes Gibraltar so important. Spain lies behind you, Morocco lies ahead. To your left is the Mediterranean and, on your right, the wild Atlantic. This is the bridgehead between Africa and Europe, the gateway between the Old World and the New. No wonder Britain has always been so determined to hold onto it. Whoever controls the Rock controls this narrow strait and all the traffic that passes through it, about a quarter of the world’s shipping. Gibraltar is tiny (only three miles long, barely a mile wide), but its strategic significance is immense.

Growing up in Britain, I learned quite a bit about Gibraltar. Everything I discovered made me determined not to go there. Their policemen dressed just like ours! They had red telephone boxes, just like us! They drank warm beer and ate roast beef and Yorkshire pudding, just like we did! They had a Royal Navy base and fired a noonday gun! It sounded so dull and dreary, a provincial English barracks town stagnating in the Spanish sunshine. A nice lifestyle for Little Englanders, maybe, but no one else.

Like a lot of Britons of my generation, I didn’t go abroad until I was 18. When I finally got away, Gibraltar was the last place on my mind. But then, five years ago, Britain voted to leave the European Union. The British media was awash with patriotic Britons who’d voted Leave, but Gibraltarians were supposed to be the most patriotic Brits of all — and 96 percent of them had voted to remain. What on earth was going on? I flew out there to find out.

The explanation for this paradox was actually fairly simple. Gibraltarians are British to their bones but, unlike most ‘mainland’ Brits, they regarded EU membership as something that bolstered their British nationhood. They saw things this way because of the nation on their doorstep. Britain seized Gibraltar from Spain in 1704, during the War of the Spanish Succession (an arcane dynastic dispute between Europe’s interrelated royal families). In the subsequent peace treaty of 1713, the Spanish ceded the peninsula to Britain in perpetuity, but they soon regretted it and they’ve spent much of the last 300 years trying to reclaim it. In 1967 General Franco closed the border, turning Gibraltar into a kind of Iberian West Berlin. After Franco’s death in 1975 things became a bit easier, but the Spanish only opened the border entirely in 1985; it was a precondition to their joining the EU. Since then, Gibraltar has prospered — and so has its Spanish hinterland. Local Spaniards need jobs, Gibraltar needs Spanish labor — and so 15,000 Spanish commuters cross into Gibraltar to work here every day. How much of this is due to the EU is a matter of opinion, but you can see why Gibraltarians were happy with the status quo.

Yet the biggest revelation wasn’t Gibraltar’s attitude to the EU, but my attitude to Gibraltar. Coming here, I realized my prejudices were unfounded. This was a fascinating place. Far from being full of sunburnt Brits, Gibraltar is a rich mix of exotic cultures. Many Gibraltarians are of Maltese, Portuguese or Genoese descent. Moroccans came here during the blockade, replacing the Spanish workers who could no longer cross the border, and when the border opened up again a lot of them stayed on. There’s a thriving Sephardic Jewish community, which has been here since the Middle Ages. There are several synagogues, two cathedrals (one Anglican, one Roman Catholic — most Gibraltarians are Catholics), a Hindu temple and a spectacular mosque. In a place with such a contested past and such a hybrid population, it’s apt that the archetypal Gibraltarian is a fictional creation — Molly Bloom, the dusky, flirty heroine of James Joyce’s Ulysses, immortalized in bronze in Gibraltar’s lush botanic gardens.

As befits a place with such a various heritage, Gibraltar is full of history. The Moors were here for over 700 years, longer than the Spanish and the British put together (the name Gibraltar is an Anglicized corruption of Jabal Tariq, the ‘Mount of Tariq’, after the Moorish commander who conquered it). Although the Spanish drove the Moors out in the 15th century, numerous Moorish sites survive. The Tower of Homage is an imposing remnant of the citadel’s Moorish fortifications. The Gibraltar Museum is built upon the foundations of the beautiful, flamboyant Moorish baths. Most of the extant buildings are British, many of them dating back to the 18th century. Main Street is lively and attractive, crowded with shops and cafés — and British pubs, of course, with quintessential English names like the Horseshoe and the Angry Friar. The Garrison Library is an elegant, serene refuge from the bustle of the Old Town. The Rock Hotel, with wonderful views across the bay, is a sublime slab of Art Deco, once patronized by Ernest Hemingway.

Until the 1980s, Gibraltar was a military base, dependent on Britain’s Ministry of Defence for over half its GDP. The Royal Naval Dockyard closed in 1984, however, and in 1990 the British garrison departed. At the time, this seemed like a catastrophe for Gibraltar’s economy. It turned out to be a blessing in disguise. A fortress no more, Gibraltar has reinvented itself as a financial center. Today banking, insurance and online gaming are among its most important industries. An extensive land reclamation program has expanded the surface area of the peninsula and clusters of attractive new apartment blocks are sprouting up on this reclaimed land. Gibraltar is no longer a colonial outpost. It feels modern, cosmopolitan. The robust ramparts that have shielded it from numerous Spanish sieges (most notably the Great Siege of 1779 to 1783) are now given over to idle recreation. The King’s Bastion, which once housed troops and artillery, now contains a cinema, a skating rink, a bowling alley and an amusement arcade. Anthony Burgess was stationed here during World War Two, a soldier in the British garrison, waiting for the German invasion that never came. He makes it sound a rough old place, ‘overcrowded and bug-ridden’. His wartime sojourn inspired his first novel, A Vision of Battlements. I wonder what he’d make of these spruced-up battlements today?

Yet what struck me most forcibly when I returned was the bizarre intimacy of the place. Gibraltar has all the trappings of a metropolis, but it only has 33,000 inhabitants, all squeezed into a few square miles. It’s a strange, surreal mélange of capital city and country town. British shops and British currency give Gibraltar an air of unreality — a British suburb, adrift in the Med — but after a while it begins to grow on you. And if it becomes too claustrophobic, the Spanish mainland is only a few miles away.

Gibraltarians reckon they’ve got the best of both worlds — and it’s hard to disagree with them. Healthcare is free for residents and so is university — either here in ‘Gib’ or back in Britain (the Gibraltarian government will cover your fees, accommodation and a couple of flights home every year). If the local hospital can’t fix you up, they’ll find you somewhere in Spain or the UK. Almost everyone speaks fluent Spanish as well as English. It’s like living in Spain and England simultaneously, with the plus points of both cultures. Sure, you can order fish ’n’ chips or a Full English breakfast if you really want to, but most of the food is international. And most locals drink their beer cold.

Above all it’s the sense of community which makes Gibraltar special. Naturally this is partly due to the size of the place: it’s hard to walk down the street without bumping into someone you know. But there’s more to it than that. Ask the locals what makes them stick together and they’ll talk about their shared adversity. Anyone over 40 can remember the Spanish blockade — and although there are few people left alive who lived through the evacuations of World War Two (when women and children were sent to Britain, leaving their menfolk behind), this collective trauma still exerts a powerful folk memory. The shrapnel scars in the city walls are a mute reminder that Gibraltar has been under siege for much of its history.

I ended my latest visit back on the Rock, that huge shard of white limestone which the ancients believed to be one of the twin Pillars of Hercules, created when Hercules broke through the Atlas Mountains, linking the Atlantic and the Med. Once upon a time, this was regarded as the end of the world. Non Plus Ultra (‘Nothing further beyond’) read the warning to sailors who ventured this far. Today, Gibraltar has become a crossroads. How daft I was to dismiss it all those years ago. Ships were chugging back and forth, so far below they looked like trinkets. Across the bay in Tarifa, a faint blur on the horizon, the evening ferry was departing for Tangier.

Two monkeys were squabbling on the cliff edge, indifferent to the sheer drop beneath them. These are the only wild monkeys in Europe, about 300 of them altogether. Legend has it that if they ever leave, the British will be driven out after them. When their numbers were declining during World War Two, Churchill commanded that they receive extra rations, to boost their numbers and maintain morale. In fact, it seems these Barbary macaques were here long before the British — or the Spanish, for that matter. DNA testing has established that they come from Africa, not Europe. They were probably brought here by the Moors, a thousand years ago or more. If Gibraltar belongs to anyone, I expect it belongs to them.

The light was fading and, as I turned to go, I found another macaque blocking my path, a baby clinging to her back, her hand stretched out for food. Our eyes met and as I walked past her I feared she might reach out and grab me. But she didn’t. When I looked back from a safe distance, she had already disappeared.

This article was originally published in The Spectator’s July 2021 World edition.