Only on my third visit to the Alhambra did I really begin to understand the writing on the wall. The palace-fortress of the Nasrid rulers of Granada can be read – if you know Arabic – just like a book. The surfaces of its ornate interiors are plastered with religious mottos and secular poetry inscribed in the exquisite calligraphy that swirls around the rooms. Previously, I had to rely on tourist guides to decipher them. So I had grasped vaguely that, in the mid-fourteenth century, the sultans Yusuf I and Mohammed V had embroidered these walls with a dynastic slogan that now reads like a fateful warning about the dangers of false modesty: ‘There is no conqueror but God.’ In 1492, of course, the conquerors were themselves conquered. The Most Catholic monarchs, Ferdinand of Aragon and Isabella of Castille, occupied the hill of the Alhambra – the ‘red fort’. Muslim al-Andalus, with Granada as its last redoubt, began to fade into glorious legend.

Then, during a literary weekend organised one blossom-laden April by the Hay Festival in and around the Alhambra, I toured the gorgeous, fragile labyrinth of brick and stucco again in the company of the exiled Palestinian poet Mourid Barghouti. In the Chamber of the Two Sisters, he gazed at the walls and began to read, translating with impromptu grace as he went: ‘We would love the stars more if they were fixed to this wall, not floating in the sky.…’ Later, I found the author of those lines: ibn Zamrak, a fourteenth-century poet-politician of Granada who would have haunted these rooms – with their repeating figures of inscriptions and mosaics arranged into a hypnotic geometry – almost every day.

To anyone with a taste for history’s own recurrent patterns, the irony felt almost too neat. Here, in the edifice that has come to symbolise the lost homeland of Islamic culture in Europe, a writer who represents the modern face of Arab dispossession traced the lines left by his ancestors. Not only from Israel-Palestine, but across a region still scarred despite its frail ‘spring’ by every stripe of unjust regime, luminaries of Arab poetry and culture have for decades had to drift in exile across distant skies. Combine this personal and artistic dislocation with the progressive urge in post-Franco Spain to reclaim the fabled tolerance of (some of) its medieval kingdoms and you can see why the ancient cities of al-Andalus have become a favoured gathering-place for many of these wandering stars. Festivals, conferences and symposia, all in various ways devoted to promoting a revival of medieval cross-cultural harmony or ‘convivencia’, have flourished across modern Andalusia over the past twenty years, often boosted by funds from foreign governments such as Saudi Arabia, Kuwait and Qatar.

I have watched Emirati notables glide through the Great Mosque in Cordoba, the brilliant capital of al-Andalus under the Umayyad caliphs, on their way to yet another fiesta of inter-faith and inter-cultural dialogue. In 1999 the Kingdom of Morocco helped to create the Foundation for Three Cultures in Seville, one the prime movers behind these events. In 2011, the 1300th anniversary of the Arab conquerors’ arrival in Spain via Gibraltar, the ‘rock of Tariq’, Cordoba itself became the first Spanish venue for the ‘Averroes Encounters’ – international debates named for the philosopher, jurist and scientific thinker ibn Rushd – ‘Averroes’ to Christian authors –who lived and taught in the twelfth-century city.

At Hay’s Alhambra festival, however, it was the stirrers rather than the sheikhs who commanded the stage. Juan Goytisolo, the veteran Spanish dissident who, aghast at Franco’s Spain, chose to ‘adopt’ Moroccan Sufi culture and settle in Marrakech, warned against the sort of high-minded talking-shop that feeds off vague platitudes. ‘We can’t generalise,’ he insisted. ‘The Arab world is like a patchwork. What applies in one country does not apply in another.’ The Lebanese author Elias Khoury, who in Gate of the Sun wrote the epic novel of the Palestinians’ tragedy, told me as we sat amid the pseudo-Moorish kitsch of the Alhambra Palace Hotel that ‘I don’t like this idea of putting writers into categories. … If I am to be read, it should not be because there are Arab elements in my work, but because it speaks to you as a human being.’

At that point, before the recent Arab uprisings, writers and thinkers from across the Middle East and North Africa did at least agree on the stifling corruption of the states that reluctantly hosted, or else expelled, them. ‘The problem of the Arabic book is the problem of Arabic society,’ Khoury affirmed. ‘It is dictatorship and censorship. And this censorship isn’t only against writers and books – it’s against the whole society.’ As he put it later, speaking under the walls of the Alhambra, ‘the freedom of the writer is meaningless if he is in a society which is not free.’

As a venue for reflections on past glories, and for dreams of greatness restored, Granada surely has no peer. The nostalgic, elegiac element to its art and myth began long before the fleeing sultan Boabdil halted on the heights south of the city and looked back, so the story goes, over his lost domain at the place of ‘the Moor’s Last Sigh’. As the final bastion of Muslim Iberia, the Nasrid kingdom acquired a sort of sunset glow prior to the final coup delivered by Ferdinand and Isabella. In fact, thanks both to the centuries-long span of the Christian ‘Reconquista’ in Spain and the gulf between the pluralistic Umayyad rulers and their more austere Berber successors the Almoravids and the Almohads, the writers of medieval al-Andalus always seem to be looking back regretfully to a vanished golden age. ‘On the morning they left/ we said goodbye/ filled with sadness/ for the absence to come,’ runs (in Cola Franzen’s translation) the famous lyric ‘Leavetaking’ by ibn Jakh of Badajoz. He was writing early in the eleventh century, almost half a millennium before Granada fell.

For some later commentators, both Arab and European, the rot had already set in when the enlightened Cordoba of the Umayyads succumbed to the Berbers in 1009, and the Caliphate began to splinter into squabbling petty kingdoms. Surely no major culture – not even the Roman Empire in the West – has ever staged a longer goodbye than al-Andalus. One of the most famous elegies for its departed splendour dates from the middle of the thirteenth century, after Seville had fallen to the Castilian kings in 1248. Abu al-Baqa al-Rundi writes (in James T Monroe’s translation) of ablution fountains that weep over ‘dwellings emptied of Islam. … Now inhabited by unbelief/ In which mosques have become churches wherein only bells and crosses may be found.’ The first line of his lament strikes the plangent note that searchers for romantic Moorish Spain have often echoed: ‘Everything declines after reaching perfection, therefore let no man be beguiled by the sweetness of a pleasant life.’ Glory, in classical Arabic verse no less than in the post-classical poetic traditions of the West, always carries within it the seeds of its own decadence.

It’s inevitable that wistful fantasies of a ‘golden age’ tell us more about the dreamers than about the dream. Golden ages always exist more tangibly in the imagination of the present than in the experience of the past. For the procession of cultural tourists and visiting artists who tramp through the Alhambra, al-Andalus often means the ideal of multicultural peace and amity that allegedly bloomed here in the past, and may now offer a template for future coexistence.

Of course, no golden age – Elizabethan England, Renaissance Florence, Periclean Athens, Mughal India – can ever stand close examination. No medieval society anywhere shared modern conceptions of equality and pluralism. To live as a Christian or Jew in al-Andalus would surely have been a preferable condition to minority status anywhere north of the Pyrenees. But the ‘dhimmi’ remained second-class citizens in some ways, protected yet controlled. Yes, in the mid eleventh century, Granada had a Jewish grand vizier, Joseph ibn Naghrela – an utterly unthinkable appointment in Christian Europe. Accused of favouring the Berber elite at the expense of the long-established Iberian Arab population, he was lynched in 1066. A massacre of the city’s Jews followed. Ibn Zamrak, whose lines Mourid Barghouti recited for me in the Chamber of the Two Sisters, practised assassination as part of his statecraft. In the manner of all medieval courts, he was dosed with his own medicine and murdered in 1393.

So, if every golden age hides a core of brass and iron under the gilt, why does the notion still appeal? For guests at a literary festival in the Alhambra, the prospect may beckon of an Arab – or at least Arab-influenced – cultural terrain where people of all faiths and both genders might speak and write in freedom and in fellowship. Nasrid Granada, don’t forget, sheltered a notable school of women poets. For Emirati bigwigs at their five-star conference hotels, I suspect that the ideal of al-Andalus might have more to do with a hands-off respect for other people’s cultural boundaries – and for the overlords’ absolute sovereignty within them – than with unfettered free expression.

As fairy tale, dreamland or utopia, Moorish Spain has gone through as many revamps and renovations as the Alhambra itself. Cultural historian Robert Irwin depicts the palace as a kind of palimpsest that embodies the vastly divergent views of its successive proprietors – Muslim emirs, Christian kings, secular bureaucrats – about its role. As a symbol, its meanings and messages still multiply.

Plenty of the Arabian Nights fantasias woven around the Alhambra by nineteenth-century Orientalists had precious little to do with sober inquiry into Islam’s past and future presence in Spain and Europe – the agenda for so many Andalusian evenings these days. In the English-speaking world, the cult of Granada got going in earnest in the 1830s, after the American writer-traveller Washington Irving published his Tales of the Alhambra in 1832. He had lived in the dilapidated palace in the late 1820s, and his Romantic sketches do manage to incorporate some fact along with all the delicious – and deeply influential – whimsy:

The amenity of its climate, where the ardent heats of a southern summer were tempered by breezes from snow-clad mountains, the voluptuous repose of its valleys and the bosky luxuriance of its groves and gardens all awakened sensations of delight, and disposed the mind to love and poetry. Hence the great number of amatory poets that flourished in Granada. …

And so on, in a jasmine-scented haze of prose that can still cast a heady spell. For example, Irving’s tale of the doomed passion of the poets Ahmed and Hafsah may owe more to Romantic convention than medieval chronicle, but Hafsa bint al-Hajj al-Rakuniyya (1135-1191) was a real enough person, and some of her amorous verses do survive.

Irving’s vision of Granada as a citadel of sensual and intellectual glamour has proved remarkably resilient. In tourism, politics, even historical research, not that much of the myth has changed since he was:

irresistibly transported in imagination to those times when Muslim Spain was a region of light amid Christian, yet benighted Europe – externally a warrior power fighting for existence, internally a realm devoted to literature, science, and the arts, where philosophy was cultivated with passion, though wrought up into subtleties and refinements, and where the luxuries of sense were transcended by those of thought and imagination.

But he wrote, of course, for Protestant and secular readers, to whom the grandeur of the Moors served as another stick to beat the barbarity of old Catholic Europe, with its prelates, torturers and inquisitors. Not that this ‘black legend’ entirely lacked a local foundation. In 1499, Archbishop Jimenez de Cisneros persuaded the Muslim judges of Granada – still formally protected, along with their community, by the guarantees given in the surrender treaty of 1492 – to bring out their precious Arabic books. He burned around 5,000 volumes, even refusing pleas from Christian scholars that they should survive.

For many local inheritors of al-Andalus, the picture of the past still looks decidedly different. If you pass, as I have done, from the consciously pluralist history on show in the Alhambra itself to the Catholic monuments of Granada, then the reconquest of 1492 swaps its costume: from catastrophe to triumph. In the Capilla Real, where the ruggedly modest tombs of Ferdinand and Isabella lie in the crypt, works of art still celebrate the capitulation of the Moors. Franco’s ultra-Catholic Spain, ‘One, Great and Free’, had no time for diversity of any kind. Even today, the chapel’s website defies critics of the Catholic kings over their persecution of Muslims, Jews and ‘heretics’ in Granada and elsewhere. It argues vigorously that the monarchs cannot be judged by modern standards and that ‘every European country applauded the Spanish kings’ initiatives, which represented safety for all of them’. In an outbreak of moral and historical relativism exceedingly rare in any institution attached to the church of Rome, the chapel’s guardians maintain that ‘Human beings’ behaviour must be judged according to the conscience, laws and traditions under which they lived.’

Notoriously, Franco’s godly forces liquidated the poet who had done most to reclaim his city’s Moorish legacy: Federico Garcia Lorca, murdered in August 1936 at the start of the Civil War. Lorca, whose final volume of verses – El Divan del Tamarit – recovered and revitalised the ghazal and qasida forms of medieval al-Andalus, lives on in the Huerta de San Vicente, the pretty house where his family spent summers between 1926 and 1936. Now an evocative museum, it sits amid a rose garden in the high-rise suburbs of southern Granada. Though feted today, Lorca once accused his city of having ‘the worst bourgeoisie in Spain’, and the reactionary spirit that killed him is by no means dead and gone. Ancient culture-wars, moreover, have recently picked up a new momentum thanks to the politics of large-scale immigration: Spain now has a Muslim population of around 1.3 million.

This migration comes in a large part from Morocco, the destination of the many of the Spanish Moors ethnically cleansed from the Iberian peninsula between the fall of Granada and the formal expulsion of ‘Moriscos’ in 1609. And behind the new cult of al-Andalus and the praise heaped on the medieval ‘convivencia’ lurks a gnawing fear. What if the Muslim Arabs of today were to lay claim to the lands of their ancestors? The paranoid politics that raises the spectre of an Islamic ‘recovery’ of al-Andalus hovers around the fringes of Spanish right-wing populism.

Its sole basis in fact lies, almost inevitably, in the rhetoric of Osama bin Laden, taken up by a few other al-Qaeda mouthpieces. From 1994, they did make the odd sweeping call for the reclamation of ‘lost’ Muslim territory. Needless to say, such delusions mean less than nothing to the actual migrants of today – who are rather less visible in Granada than in many working-class suburbs of Madrid, save for the Moroccan tea shops that cluster near the foot of the Alhambra hill or the craft emporia dotted around the old Muslim quarter of the Albaicin, across the river Darro.

However, on this happy hunting ground for illusion and fantasy, a few mavericks do yearn to turn back history’s clock. Take, for instance, Sheikh Abdelqadir as-Sufi of the ‘Grand Mosque’ of Granada. Sited in a traditionally-styled building on Plaza San Nicolas in the Albaicin, the mosque was inaugurated in its current home by the ruler of Sharjah in 2003. I had passed the mosque, which commands magnificent views across the valley to the Alhambra, while wandering through the Albaicin, and had casually assumed it to be a mainstream institution born of the post-Franco reawakening of tolerance. But in Granada, refuge of dreamers, things can often be not quite as they seem.

Thanks to a comprehensive book on Iberia’s modern Muslims by the Spanish-based journalist Marvine Howe, Al-Andalus Rediscovered, I now know more about the Sheikh and his mosque. In the 1980s, he founded the ‘Murabitun World Movement’ which calls for the non-violent restoration of the personal rule of the Caliphate and for currency reform through the circulation of an Islamic ‘gold dinar’. For all his romance with the legacy of Granada, the Sheikh has more recently lived in Cape Town, where he founded a seminary.

As you might guess, Sheikh Abdalqadir is in fact a convert to Islam. It is his original identity that seems to fit so neatly with the record of modern Granada as a perennially appealing stage-set on which fantasists of every sort can play out their golden-age scenarios. For the Sheikh is in reality a Scot named Ian Dallas. Born in Ayr, Dallas trained at RADA, then acted and wrote plays and television scripts for the BBC. He even played a minor role in Fellini’s self-reflexive classic of the director’s life, ‘8 ½’. Dallas-Abdalqadir converted to Islam in Fes in 1967, and wrote prolifically before turning to Muslim Granada as the backdrop for the grandest production of his career.

On this historic stage where theatrical nostalgia can seize hold of religion, politics and scholarship, perhaps overt and undisguised fiction offers the most honest route back to lost world of the Alhambra. In Granada I also talked with Radwa Ashour, the Egyptian novelist and academic who is married to Mourid Barghouti and, for long years, shared his exile as another wandering star. Her ‘Granada’ trilogy dramatises the fall of the Nasrid kingdom and the slow extinction of its culture under Catholic rule, via the struggles of the learned bookbinder Abu Jafaar and his family. Not surprisingly, some critics have seen in her work a kind of allegory of the Palestinian nakba and its aftermath, as well as a resurrection of al-Andalus.

I asked Ashour how it felt to sit amid the settings of her fiction, with the legend made visible in – much-renovated – stone, brick and stucco all around. She was ‘a bit troubled and confused’ to be in Granada, she confided, ‘because my characters are still living with me. I know they’re somewhere here.’ As Ashour put it, and no visitor would disagree, ‘I feel that there are spectres hovering over the place, but they’re very real ghosts.’ Granada may still be Europe’s prime location for conversation with those alluring ghosts. Nonetheless, any future golden age of harmony and tolerance will have to be built without any phantom assistance.

Elsewhere on Critical Muslim: